Last active
December 18, 2015 22:29
-
-
Save philipcristiano/5854546 to your computer and use it in GitHub Desktop.
Gunicorn worker hook with health check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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