pprint
This commit is contained in:
parent
b5ac53f0e6
commit
d4a373b29a
1 changed files with 2 additions and 1 deletions
3
app.py
3
app.py
|
@ -3,6 +3,7 @@ from pathlib import Path
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
from requests import post
|
from requests import post
|
||||||
from fastapi import FastAPI, Response, Header, status
|
from fastapi import FastAPI, Response, Header, status
|
||||||
|
@ -39,7 +40,7 @@ ctx = {}
|
||||||
async def lifespan(app: FastAPI):
|
async def lifespan(app: FastAPI):
|
||||||
ctx["daily"] = Path("analytics_daily.txt").read_text("UTF-8")
|
ctx["daily"] = Path("analytics_daily.txt").read_text("UTF-8")
|
||||||
ctx["hourly"] = Path("analytics_hourly.txt").read_text("UTF-8")
|
ctx["hourly"] = Path("analytics_hourly.txt").read_text("UTF-8")
|
||||||
print(ctx)
|
pprint(ctx)
|
||||||
yield
|
yield
|
||||||
ctx.clear()
|
ctx.clear()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue