Extract startup resource initialization from main.py

Move lifespan startup logic into app.startup and remove local imports from app.main._lifespan. Mark startup wiring issue as done.
This commit is contained in:
2026-04-07 20:48:29 +02:00
parent effcc65e1b
commit 1fc04ed978
4 changed files with 86 additions and 69 deletions

View File

@@ -29,7 +29,7 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
- Fix: document the single-process limitation clearly in code and project docs.
- Expected outcome: authentication behavior is consistent across deployment modes, and session invalidation works correctly in multi-worker setups.
- `backend/app/main.py` uses local imports inside `_lifespan()` to avoid circular dependencies, indicating that startup logic is tightly coupled with services.
- Status: **done** `backend/app/main.py` uses local imports inside `_lifespan()` to avoid circular dependencies, indicating that startup logic is tightly coupled with services.
- Fix: evaluate whether the startup initialization can be moved into a dedicated `startup.py` or split service initialization into smaller modules; keep import order simple and explicit.
- Expected outcome: cleaner startup code with lower coupling, fewer hidden circular import risks, and easier maintenance.