Skip to content

Instantly share code, notes, and snippets.

@philipcristiano
Last active December 18, 2015 22:29
Show Gist options
  • Save philipcristiano/5854546 to your computer and use it in GitHub Desktop.
Save philipcristiano/5854546 to your computer and use it in GitHub Desktop.
Gunicorn worker hook with health check
def post_worker_init(worker):
env = {
'REQUEST_METHOD': 'GET',
'PATH_INFO': '/_status',
}
def start_response(*args, **kwargs):
_send_udp(args[0])
worker.wsgi(env, start_response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment