Remove deprecated code thing
This commit is contained in:
parent
2677e645b1
commit
de62b09437
1 changed files with 4 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
import contextlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
|
@ -124,7 +125,7 @@ CACHE_FILE = CACHE_DIR / "db.sqlite3"
|
|||
logging.debug("Cache file: %r", CACHE_FILE)
|
||||
|
||||
|
||||
@app.on_event("startup")
|
||||
@contextlib.asynccontextmanager
|
||||
async def startup():
|
||||
if not CACHE_DIR.exists():
|
||||
CACHE_DIR.mkdir(parents=True)
|
||||
|
@ -139,6 +140,7 @@ async def startup():
|
|||
)
|
||||
"""
|
||||
)
|
||||
yield
|
||||
|
||||
|
||||
def upload_media(domain: str, access_token: str, file: io.BytesIO, filename: str, content_type: str):
|
||||
|
@ -196,7 +198,7 @@ def preview_url(
|
|||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
"SELECT metadata,ts FROM cache WHERE url = ?",
|
||||
(url, ts)
|
||||
(url,)
|
||||
)
|
||||
results = cursor.fetchall()
|
||||
if results:
|
||||
|
|
Loading…
Reference in a new issue