From ed6e9e85bf42b995f05d086b356c019e76513f80 Mon Sep 17 00:00:00 2001 From: Yogesh Thambidurai Date: Wed, 5 Nov 2025 21:15:29 -0500 Subject: [PATCH] configure django's database connections --- tcf_core/settings/base.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tcf_core/settings/base.py b/tcf_core/settings/base.py index 6d4e83f5a..f81f98785 100644 --- a/tcf_core/settings/base.py +++ b/tcf_core/settings/base.py @@ -104,6 +104,15 @@ "PASSWORD": env.str("AWS_RDS_PASSWORD"), "HOST": env.str("AWS_RDS_HOST"), "PORT": env.int("AWS_RDS_PORT"), + # Connection pooling - reuse connections between requests + "CONN_MAX_AGE": 60, # Keep connections alive for 60 seconds + # Health checks (Django 4.1+) - verify connection is still valid + "CONN_HEALTH_CHECKS": True, + # Database connection options + "OPTIONS": { + "connect_timeout": 10, # Timeout for establishing connection + "options": "-c statement_timeout=30000", # 30 second query timeout + }, } }