mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
- Fix lifespan function to access db_path from create_app scope via closure - Prevents "no such table: jobs" error by ensuring database initialization runs - Previous version tried to access app.state.db_path before it was set The issue was that app.state is set after FastAPI instantiation, but the lifespan function needs the db_path during startup. Using closure allows the lifespan function to capture db_path from the create_app function scope.