change gunicorn timeout to 240 seconds

This commit is contained in:
Kenneth Kehl
2025-07-30 10:51:54 -07:00
parent 902e3e85f7
commit e82e138771
2 changed files with 7 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ watch-frontend: ## Build frontend and watch for changes
.PHONY: run-flask .PHONY: run-flask
run-flask: ## 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 .PHONY: run-flask-bare
run-flask-bare: ## Run flask without invoking poetry so we can override ENV variables in .env run-flask-bare: ## Run flask without invoking poetry so we can override ENV variables in .env

View File

@@ -2,7 +2,8 @@ import multiprocessing
import os import os
import sys import sys
import traceback import traceback
import logging
from app.utils import hilite
import gunicorn import gunicorn
# Let gunicorn figure out the right number of workers # Let gunicorn figure out the right number of workers
@@ -11,6 +12,10 @@ import gunicorn
# so adjust it. # so adjust it.
workers = multiprocessing.cpu_count() workers = multiprocessing.cpu_count()
worker_class = "gevent" 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")) bind = "0.0.0.0:{}".format(os.getenv("PORT"))
disable_redirect_access_to_syslog = True disable_redirect_access_to_syslog = True
gunicorn.SERVER_SOFTWARE = "None" gunicorn.SERVER_SOFTWARE = "None"