mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
- Add database initialization to API lifespan event handler - DEV mode: Reset database on startup (unless PRESERVE_DEV_DATA=true) - PROD mode: Ensure database schema exists - Migrate from deprecated @app.on_event to modern lifespan context manager - Fixes 400 error "Another simulation job is already running" on fresh container starts This ensures the dev database is reset when the API server starts in dev mode, preventing stale "running" or "pending" jobs from blocking new job creation.