From 8708a8f6a3c1c2b58c24ff72a717407d6042fad5 Mon Sep 17 00:00:00 2001 From: Olivier Leger Date: Wed, 10 Jun 2020 20:19:01 -0300 Subject: [PATCH] Create dynamic uwsgi pass timeout based on Harakiri timeout --- helpers/config.py | 6 +++--- helpers/template.py | 1 + .../kobo-docker/docker-compose.frontend.override.yml.tpl | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/helpers/config.py b/helpers/config.py index 1c45e7f..4c0df48 100644 --- a/helpers/config.py +++ b/helpers/config.py @@ -28,9 +28,9 @@ class Config: DEFAULT_PROXY_PORT = "8080" DEFAULT_NGINX_PORT = "80" DEFAULT_NGINX_HTTPS_PORT = "443" - KOBO_DOCKER_BRANCH = '2.020.24' - KOBO_INSTALL_BRANCH = 'master' - KOBO_INSTALL_VERSION = '2.3.0' + KOBO_DOCKER_BRANCH = 'dynamic-uwsgi-pass-timeout' + KOBO_INSTALL_BRANCH = 'dynamic-uwsgi-pass-timeout' + KOBO_INSTALL_VERSION = '2.4.1' # Maybe overkill. Use this class as a singleton to get the same configuration # for each instantiation. diff --git a/helpers/template.py b/helpers/template.py index b523b04..b90af6d 100644 --- a/helpers/template.py +++ b/helpers/template.py @@ -199,6 +199,7 @@ def _get_value(property_, true_value="", false_value="#", "UWSGI_SOFT_LIMIT": int(config.get("uwsgi_soft_limit")) * 1024 * 1024, "UWSGI_HARAKIRI": config.get("uwsgi_harakiri"), "UWSGI_WORKER_RELOAD_MERCY": config.get("uwsgi_worker_reload_mercy"), + "UWSGI_PASS_TIMEOUT": int(config.get("uwsgi_harakiri")) + 10, "POSTGRES_REPLICATION_PASSWORD": config.get("postgres_replication_password"), "WSGI_SERVER": "runserver_plus" if config_object.dev_mode else "uWSGI", "USE_X_FORWARDED_HOST": "" if config_object.dev_mode else "#", diff --git a/templates/kobo-docker/docker-compose.frontend.override.yml.tpl b/templates/kobo-docker/docker-compose.frontend.override.yml.tpl index bc0741f..0b0b9f9 100644 --- a/templates/kobo-docker/docker-compose.frontend.override.yml.tpl +++ b/templates/kobo-docker/docker-compose.frontend.override.yml.tpl @@ -62,6 +62,7 @@ services: nginx: environment: - NGINX_PUBLIC_PORT=${NGINX_PUBLIC_PORT} + - UWSGI_PASS_TIMEOUT=${UWSGI_PASS_TIMEOUT} ports: - ${NGINX_EXPOSED_PORT}:80 ${USE_EXTRA_HOSTS}extra_hosts: