-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig.py
More file actions
36 lines (29 loc) · 970 Bytes
/
config.py
File metadata and controls
36 lines (29 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
from os.path import dirname, realpath
import faulthandler
faulthandler.enable()
bind = '0.0.0.0'
try:
workers = int(os.environ.get('GUNICORN_WORKERS', 'not set'))
if workers < 1:
raise ValueError()
except (NameError, ValueError):
workers = (os.cpu_count() or 4) * 2 + 1
pythonpath = dirname(dirname(dirname(realpath(__file__))))
timeout = 1200
pidfile = '/tmp/gunicorn.pid'
logger_class = 'deis.gunicorn.logging.Logging'
loglevel = 'info'
errorlog = '-'
accesslog = '-'
access_log_format = '%(h)s "%(r)s" %(s)s %(b)s "%(a)s"'
def worker_int(worker):
"""Print a stack trace when a worker receives a SIGINT or SIGQUIT signal."""
worker.log.warning('worker terminated')
import traceback
traceback.print_stack()
def worker_abort(worker):
"""Print a stack trace when a worker receives a SIGABRT signal, generally on timeout."""
worker.log.warning('worker aborted')
import traceback
traceback.print_stack()