khoj-ai / khoj

Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
https://khoj.dev
GNU Affero General Public License v3.0
16.19k stars 795 forks source link

Fix database connections leakage (#980) #981

Closed rznzippy closed 1 week ago

rznzippy commented 1 week ago

Description

This pull request addresses a database connection leak caused by django-apscheduler not closing stale connections after task execution. The solution involves wrapping run_with_process_lock with the @close_old_connections decorator provided by django-apscheduler.

For more details, refer to the django-apscheduler documentation on database connections and timeouts.

Changes

Related Issue