diff --git a/InvenTree/gunicorn.conf.py b/InvenTree/gunicorn.conf.py index b11999aadd..c1b403de12 100644 --- a/InvenTree/gunicorn.conf.py +++ b/InvenTree/gunicorn.conf.py @@ -8,3 +8,6 @@ workers = multiprocessing.cpu_count() * 2 + 1 max_requests = 1000 max_requests_jitter = 50 + +# preload app so that the ready functions are only executed once +preload_app = True diff --git a/docker/gunicorn.conf.py b/docker/gunicorn.conf.py index 750f293380..58b48a0c8d 100644 --- a/docker/gunicorn.conf.py +++ b/docker/gunicorn.conf.py @@ -37,3 +37,6 @@ logger.info(f"Starting gunicorn server with {workers} workers") max_requests = 1000 max_requests_jitter = 50 + +# preload app so that the ready functions are only executed once +preload_app = True diff --git a/docs/_includes/gunicorn.conf.py b/docs/_includes/gunicorn.conf.py index aeee2a366b..ee86c6f461 100644 --- a/docs/_includes/gunicorn.conf.py +++ b/docs/_includes/gunicorn.conf.py @@ -3,3 +3,6 @@ import multiprocessing bind = "0.0.0.0:8000" workers = multiprocessing.cpu_count() * 2 + 1 + +# preload app so that the ready functions are only executed once +preload_app = True