Files
notifications-api/gunicorn_config.py

33 lines
819 B
Python
Raw Normal View History

import os
2017-09-22 15:34:43 +01:00
import sys
import traceback
import gunicorn
2017-09-22 15:34:43 +01:00
from gds_metrics.gunicorn import child_exit # noqa
workers = 4
worker_class = "eventlet"
worker_connections = 256
errorlog = "/home/vcap/logs/gunicorn_error.log"
bind = "0.0.0.0:{}".format(os.getenv("PORT"))
statsd_host = "{}:8125".format(os.getenv("STATSD_HOST"))
gunicorn.SERVER_SOFTWARE = 'None'
2017-09-22 15:34:43 +01:00
def on_starting(server):
server.log.info("Starting Notifications API")
def worker_abort(worker):
worker.log.info("worker received ABORT {}".format(worker.pid))
for threadId, stack in sys._current_frames().items():
2017-09-25 16:24:35 +01:00
worker.log.error(''.join(traceback.format_stack(stack)))
def on_exit(server):
server.log.info("Stopping Notifications API")
def worker_int(worker):
worker.log.info("worker: received SIGINT {}".format(worker.pid))