feat(scheduler): add APScheduler integration with cron support

This commit is contained in:
2026-05-11 22:03:03 +02:00
parent 4d2c21a42e
commit a4a16655b9
2 changed files with 85 additions and 0 deletions
+4
View File
@@ -5,12 +5,16 @@ from contextlib import asynccontextmanager
from app.database import engine, Base
from app import models # noqa: F401 - registers models with Base.metadata
from app.routers import sources, jobs, executions, backups, settings, dashboard
from backup.scheduler import backup_scheduler
@asynccontextmanager
async def lifespan(app: FastAPI):
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
backup_scheduler.start()
await backup_scheduler.sync_schedules()
yield
backup_scheduler.shutdown()
app = FastAPI(
title="Backup Tool API",