From 0c5e717267cf739e9f3e969111bd1102f4a36575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonah=20Br=C3=BCchert?= Date: Wed, 14 Aug 2024 03:11:24 +0200 Subject: Don't keep db connections open Recycling connections is useful, but at least on the older Django version we are currently using, connections are not properly cleaned up this way. --- src/lib/Bcfg2/DBSettings.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Bcfg2/DBSettings.py b/src/lib/Bcfg2/DBSettings.py index 5d2df6078..7b99d790d 100644 --- a/src/lib/Bcfg2/DBSettings.py +++ b/src/lib/Bcfg2/DBSettings.py @@ -125,7 +125,8 @@ def finalize_django_config(opts=None, silent=False): HOST=opts.db_host, PORT=opts.db_port, OPTIONS=opts.db_opts, - SCHEMA=opts.db_schema)) + SCHEMA=opts.db_schema, + CONN_MAX_AGE=0)) if (hasattr(opts, "reporting_db_engine") and opts.reporting_db_engine is not None): @@ -137,7 +138,8 @@ def finalize_django_config(opts=None, silent=False): HOST=opts.reporting_db_host, PORT=opts.reporting_db_port, OPTIONS=opts.reporting_db_opts, - SCHEMA=opts.reporting_db_schema) + SCHEMA=opts.reporting_db_schema, + CONN_MAX_AGE=0) settings['TIME_ZONE'] = opts.time_zone -- cgit v1.2.3-1-g7c22