Fix startup and Gemini provider handling
This commit is contained in:
@@ -12,6 +12,10 @@ from routers import documents, review, search, upload, auth
|
||||
from services.auth_service import get_session, cleanup_expired_sessions
|
||||
|
||||
|
||||
Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True)
|
||||
Path("data").mkdir(exist_ok=True)
|
||||
|
||||
|
||||
class CachedStaticFiles(StaticFiles):
|
||||
"""StaticFiles that sets a long Cache-Control header so browsers
|
||||
don't re-download the same image on every refresh."""
|
||||
@@ -29,8 +33,6 @@ class CachedStaticFiles(StaticFiles):
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True)
|
||||
Path("data").mkdir(exist_ok=True)
|
||||
create_tables()
|
||||
try:
|
||||
cleanup_expired_sessions()
|
||||
|
||||
Reference in New Issue
Block a user