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 io
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
@ -124,7 +125,7 @@ CACHE_FILE = CACHE_DIR / "db.sqlite3"
|
||||||
logging.debug("Cache file: %r", CACHE_FILE)
|
logging.debug("Cache file: %r", CACHE_FILE)
|
||||||
|
|
||||||
|
|
||||||
@app.on_event("startup")
|
@contextlib.asynccontextmanager
|
||||||
async def startup():
|
async def startup():
|
||||||
if not CACHE_DIR.exists():
|
if not CACHE_DIR.exists():
|
||||||
CACHE_DIR.mkdir(parents=True)
|
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):
|
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 = conn.cursor()
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"SELECT metadata,ts FROM cache WHERE url = ?",
|
"SELECT metadata,ts FROM cache WHERE url = ?",
|
||||||
(url, ts)
|
(url,)
|
||||||
)
|
)
|
||||||
results = cursor.fetchall()
|
results = cursor.fetchall()
|
||||||
if results:
|
if results:
|
||||||
|
|
Loading…
Reference in a new issue