mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-08 14:14:27 -05:00
25 lines
661 B
Python
25 lines
661 B
Python
import multiprocessing
|
|
import os
|
|
import sys
|
|
import traceback
|
|
|
|
import gunicorn
|
|
|
|
# Let gunicorn figure out the right number of workers
|
|
# The recommended formula is cpu_count() * 2 + 1
|
|
# but we have an unusual configuration with a lot of cpus and not much memory
|
|
# so adjust it.
|
|
workers = multiprocessing.cpu_count()
|
|
worker_class = "gevent"
|
|
|
|
timeout = 240
|
|
bind = "0.0.0.0:{}".format(os.getenv("PORT"))
|
|
disable_redirect_access_to_syslog = True
|
|
gunicorn.SERVER_SOFTWARE = "None"
|
|
|
|
|
|
def worker_abort(worker):
|
|
worker.log.info("worker received ABORT")
|
|
for stack in sys._current_frames().values():
|
|
worker.log.error("".join(traceback.format_stack(stack)))
|