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"