move database and file storage from edgedb and disk to convex

This commit is contained in:
2025-12-22 02:04:10 +01:00
parent 88d72e3ee1
commit d635da039f
8 changed files with 439 additions and 482 deletions
+8 -10
View File
@@ -2,7 +2,8 @@ from my_modules.functions import custom_limit_key
from my_modules.app.constens import SECRET_KEY, UPLOAD_DIR
from my_modules.AsyncCache import AsyncCache
from my_modules.app.logger import logger
from my_modules.db.EdgeDB import EdgeDB
from my_modules.db.ConvexDB import ConvexDB
from quart_session import Session
from flask_limiter import Limiter
@@ -66,15 +67,12 @@ LIMITER = Limiter(
)
@app.before_serving
async def init_edgedb():
app.edgedb = EdgeDB(
database=os.getenv("EDGEDB_DATABASE"),
tls_security=None if app.debug else 'insecure'
)
await app.edgedb.connect()
async def init_convex():
app.convex = ConvexDB(os.getenv("CONVEX_URL"), service='nanoshare')
await app.convex.connect()
@app.after_serving
async def close_edgedb():
if app.edgedb:
await app.edgedb.close()
async def close_convex():
if app.convex:
await app.convex.close()
await logger.shutdown()