Replace 488 manual db.close() calls with middleware/dependency context manager #30
Labels
No Label
ai-changes-requested
ai-failed
ai-merged
ai-pr-opened
ai-reviewed
ai-reviewing
ai-reviewing
ai-working
bug
enhancement
evolution
performance
phase-0
phase-1a
phase-1b
phase-1c
phase-1d
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-database#30
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
488 `db.close()` calls across 31 files. Every endpoint must manually close on every code path. Any uncaught exception leaks a connection. Standard approach: middleware or dependency with try/finally.
Priority: high
Fixed in PR #33: #33
Added a
db_session_middlewaretoapp/main.pythat opens the connection at the start of each request and closes it in atry/finallyblock. Removed all 467 manualdb.close()calls from the 30 router files inapp/routers_v2/.