feat(scheduler): APScheduler 3 jobs météo dans FastAPI lifespan

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 14:50:33 +01:00
parent 3b1601a07b
commit 2ca8281b0a
2 changed files with 114 additions and 0 deletions

View File

@@ -21,7 +21,13 @@ async def lifespan(app: FastAPI):
create_db_and_tables()
from app.seed import run_seed
run_seed()
# Démarrer le scheduler météo
from app.services.scheduler import setup_scheduler
setup_scheduler()
yield
# Arrêter le scheduler
from app.services.scheduler import scheduler
scheduler.shutdown(wait=False)
app = FastAPI(title="Jardin API", lifespan=lifespan)