Skip to content

fix: graceful db shutdown and correct Docker healthcheck URL#90

Merged
shubham3121 merged 1 commit into
mainfrom
fix/container-health
Feb 23, 2026
Merged

fix: graceful db shutdown and correct Docker healthcheck URL#90
shubham3121 merged 1 commit into
mainfrom
fix/container-health

Conversation

@shubham3121

Copy link
Copy Markdown
Member

This pull request makes improvements to the application's health check endpoints and ensures proper cleanup of database connections during shutdown. The changes affect both deployment configuration and backend shutdown logic.

Health check endpoint updates:

  • Updated the health check URL in both the Dockerfile and docker-compose.yml to use /api/v1/health instead of /health, ensuring consistency with the application's API routes. [1] [2]

Database connection management:

  • Added an async dispose method to the database class in database.py to close all pooled connections and dispose of the engine cleanly.
  • Modified the FastAPI application's shutdown sequence in main.py to call the new dispose method, ensuring all database connections are properly closed during shutdown.

 - Dispose the async database engine on shutdown to close all pooled
 aiosqlite connections cleanly, eliminating ResourceWarning on exit.
 - Fix healthcheck URL in both Dockerfile and docker-compose.yml to use
 the actual endpoint at /api/v1/health instead of /health (404).
@shubham3121 shubham3121 merged commit d41f02a into main Feb 23, 2026
2 checks passed
@shubham3121 shubham3121 deleted the fix/container-health branch February 23, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant