Update the worker status endpoint to be ELB friendly.
This commit is contained in:
parent
8a2c88488a
commit
74d1c4e6b0
1 changed files with 3 additions and 0 deletions
|
@ -40,6 +40,9 @@ class WorkerStatusHandler(BaseHTTPRequestHandler):
|
||||||
# Return the worker status
|
# Return the worker status
|
||||||
code = 200 if self.server.worker.is_healthy() else 503
|
code = 200 if self.server.worker.is_healthy() else 503
|
||||||
self.send_response(code)
|
self.send_response(code)
|
||||||
|
self.send_header('Content-Type', 'text/plain')
|
||||||
|
self.end_headers()
|
||||||
|
self.wfile.write('OK')
|
||||||
elif self.path == '/terminate':
|
elif self.path == '/terminate':
|
||||||
# Return whether it is safe to terminate the worker process
|
# Return whether it is safe to terminate the worker process
|
||||||
code = 200 if self.server.worker.is_terminated() else 503
|
code = 200 if self.server.worker.is_terminated() else 503
|
||||||
|
|
Reference in a new issue