MarseyWorld/gunicorn.conf.py

31 lines
1.1 KiB
Python
Raw Normal View History

2022-08-24 01:40:17 +00:00
bind = '0.0.0.0:5000'
worker_class = 'gevent'
max_requests = 30000
max_requests_jitter = 30000
reload = True
2022-09-27 06:02:02 +00:00
reload_engine = 'poll'
2022-08-24 01:40:17 +00:00
def worker_abort(worker):
worker.log.warning(f"Worker {worker.pid} received SIGABRT.")
try:
from flask import g, request
if g and request:
2023-01-03 08:03:19 +00:00
worker.log.warning(f"\n\n★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★")
2022-12-25 04:36:08 +00:00
worker.log.warning(f"While serving {request.method} {request.url}")
u = getattr(g, 'v', None)
if u:
2022-12-25 04:36:08 +00:00
worker.log.warning(f"User: {u.username!r} id:{u.id}")
else:
2022-12-25 04:36:08 +00:00
worker.log.warning(f"User: not logged in")
2023-01-03 08:03:19 +00:00
worker.log.warning(f"\n★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n")
else:
worker.log.warning("No request info")
except:
worker.log.warning("Failed to get request info")
2022-08-24 01:40:17 +00:00
import os
os.abort()