Gunicorn worker hints app weather it is being terminated
For now, `Sanic.is_running` is set when the worker is started but not unset when it is about to stopped. Setting the flag for quit signal will not affect working requests, but the `Sanic.is_running` flag still can be used to support graceful termination.
This commit is contained in:
parent
e1331fc0a2
commit
29b4a2a08c
|
@ -159,6 +159,7 @@ class GunicornWorker(base.Worker):
|
|||
|
||||
def handle_quit(self, sig, frame):
|
||||
self.alive = False
|
||||
self.app.callable.is_running = False
|
||||
self.cfg.worker_int(self)
|
||||
|
||||
def handle_abort(self, sig, frame):
|
||||
|
|
Loading…
Reference in New Issue
Block a user