Add events
This commit is contained in:
@@ -6,8 +6,9 @@ from fastapi.staticfiles import StaticFiles
|
||||
from pathlib import Path
|
||||
|
||||
from app.core.config import settings
|
||||
from app.core.database import engine, Base
|
||||
from app.core.database import engine, Base, async_session_maker
|
||||
from app.api.v1 import router as api_router
|
||||
from app.services.event_scheduler import event_scheduler
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -22,9 +23,13 @@ async def lifespan(app: FastAPI):
|
||||
(upload_dir / "covers").mkdir(parents=True, exist_ok=True)
|
||||
(upload_dir / "proofs").mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Start event scheduler
|
||||
await event_scheduler.start(async_session_maker)
|
||||
|
||||
yield
|
||||
|
||||
# Shutdown
|
||||
await event_scheduler.stop()
|
||||
await engine.dispose()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user