mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Manually close old db connections periodically
This commit is contained in:
parent
acfdc8da77
commit
0816cec4bc
1 changed files with 8 additions and 0 deletions
|
@ -328,6 +328,14 @@ def update_content_index_regularly():
|
|||
)
|
||||
|
||||
|
||||
@schedule.repeat(schedule.every(1).to(2).hours)
|
||||
def close_all_db_connections():
|
||||
from django import db
|
||||
|
||||
db.close_old_connections()
|
||||
logger.info("🔌 Closed all database connections for explicit recycling.")
|
||||
|
||||
|
||||
def configure_search_types():
|
||||
# Extract core search types
|
||||
core_search_types = {e.name: e.value for e in SearchType}
|
||||
|
|
Loading…
Reference in a new issue