Commit 6e97dd3
committed
fastapi-sqlalchemy-pg-catalog/app: dispose engine pool on lifespan shutdown
Add try/finally around the lifespan yield so engine.dispose() runs
at shutdown. Releases pooled psycopg2 connections cleanly across
repeated start/stop cycles (local repro loops, CI lane reruns),
which otherwise leak half-open postgres connections.
Refs Copilot review on #102.
Signed-off-by: Akash Kumar <meakash7902@gmail.com>1 parent 226009f commit 6e97dd3
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
0 commit comments