From e82e138771fe402bcfc55111730d3202635c0dc0 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 30 Jul 2025 10:51:54 -0700 Subject: [PATCH] change gunicorn timeout to 240 seconds --- Makefile | 2 +- gunicorn_config.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 97cd2d682..8684a22e2 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ watch-frontend: ## Build frontend and watch for changes .PHONY: run-flask run-flask: ## Run flask - poetry run newrelic-admin run-program flask run -p 6012 --host=0.0.0.0 + poetry run newrelic-admin run-program gunicorn -c gunicorn_config.py gunicorn_entry:application -b 0.0.0.0:6012 .PHONY: run-flask-bare run-flask-bare: ## Run flask without invoking poetry so we can override ENV variables in .env diff --git a/gunicorn_config.py b/gunicorn_config.py index 4971de009..2643f78c9 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -2,7 +2,8 @@ import multiprocessing import os import sys import traceback - +import logging +from app.utils import hilite import gunicorn # Let gunicorn figure out the right number of workers @@ -11,6 +12,10 @@ import gunicorn # so adjust it. workers = multiprocessing.cpu_count() worker_class = "gevent" + +logging.basicConfig(level=logging.INFO) +logging.info(hilite("Gunicorn timeout set to 240 seconds")) +timeout = 240 bind = "0.0.0.0:{}".format(os.getenv("PORT")) disable_redirect_access_to_syslog = True gunicorn.SERVER_SOFTWARE = "None"