Skip to content

Ensure MCP db connections are cleaned up - #319

Open
alexbainter wants to merge 1 commit into
mainfrom
alex-302-async-db-connection-cleanup
Open

Ensure MCP db connections are cleaned up#319
alexbainter wants to merge 1 commit into
mainfrom
alex-302-async-db-connection-cleanup

Conversation

@alexbainter

@alexbainter alexbainter commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #302.

Adds a new decorator sync_to_async_with_db_cleanup which wraps sync_to_async but also ensures Django database connections are cleaned up after use. Django normally does this for us, but because we're doing MCP operations outside of Django and in a worker, we need to clean these connections up ourselves.

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.

Close stale database connections used by the MCP server

1 participant