From ddab0ca0dd219245c86708add2473a932fbea177 Mon Sep 17 00:00:00 2001
From: "alexander.pace@ligo.org" <alexander.pace@ligo.org>
Date: Sun, 2 Feb 2020 11:06:13 -0600
Subject: [PATCH] Enabling CONN_MAX_AGE

This allows for persistent database connections for workers.
---
 config/gunicorn_config.py         | 6 +++---
 config/settings/base.py           | 2 +-
 config/settings/container/base.py | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/config/gunicorn_config.py b/config/gunicorn_config.py
index 507ab2262..af605e29a 100644
--- a/config/gunicorn_config.py
+++ b/config/gunicorn_config.py
@@ -19,15 +19,15 @@ workers = multiprocessing.cpu_count()*2 + 1
 
 # Worker class.
 # 
-worker_class = 'gthread'
-threads = 2
+worker_class = 'sync'
+#threads = 2
 
 # Adding options for timeout. Not specified, the timeout default 
 # is 30 seconds. Source:
 #
 # https://gunicorn-docs.readthedocs.io/en/stable/settings.html#worker-processes
 #
-timeout = 120
+timeout = 300
 
 # Max requests settings - a worker restarts after handling this many
 # requests. May be useful if we have memory leak problems.
diff --git a/config/settings/base.py b/config/settings/base.py
index 6cd3f636d..32bb2fffc 100644
--- a/config/settings/base.py
+++ b/config/settings/base.py
@@ -26,7 +26,7 @@ MAINTENANCE_MODE = False
 MAINTENANCE_MODE_MESSAGE = None
 
 # Version ---------------------------------------------------------------------
-PROJECT_VERSION = '2.8.1'
+PROJECT_VERSION = '2.8.1-1'
 
 # Unauthenticated access ------------------------------------------------------
 # This variable should eventually control whether unauthenticated access is
diff --git a/config/settings/container/base.py b/config/settings/container/base.py
index 8fad4fa12..7914e3b89 100644
--- a/config/settings/container/base.py
+++ b/config/settings/container/base.py
@@ -115,6 +115,7 @@ DATABASES = {
             # NOTE: for mysql>=5.7 this will need to be changed to
             #'init_command': 'SET default_storage_engine=MyISAM',
         },
+        'CONN_MAX_AGE': 3600,
     }
 }
 
-- 
GitLab