From c71486c32d5a59547da94d3cb8e9973b155c8cce Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@archlinux.org>
Date: Sat, 20 Jul 2024 14:06:08 +0200
Subject: [PATCH] archweb: allow re-using the postgresql connection

Keep postgresql connections around for 5 minutes this avoids expensive
authentication requests.
---
 roles/archweb/templates/local_settings.py.j2 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/roles/archweb/templates/local_settings.py.j2 b/roles/archweb/templates/local_settings.py.j2
index 949a29c0d..1fc36e5cd 100644
--- a/roles/archweb/templates/local_settings.py.j2
+++ b/roles/archweb/templates/local_settings.py.j2
@@ -23,6 +23,7 @@ DATABASES = {
     'default': {
         'ENGINE'  : 'django.db.backends.postgresql_psycopg2',
         'PORT'    : 5432,
+        'CONN_MAX_AGE' : 600,
 {% if archweb_db_host != 'localhost' %}
         'HOST'    : '{{ archweb_db_host }}',
 {% endif %}
-- 
GitLab