Trigger before_stop before closing server, after_stop before closing
loop
This commit is contained in:
parent
decd3e737c
commit
7ca9116e37
|
@ -44,13 +44,13 @@ class GunicornWorker(base.Worker):
|
||||||
self.loop)
|
self.loop)
|
||||||
self.loop.run_until_complete(self._check_alive())
|
self.loop.run_until_complete(self._check_alive())
|
||||||
finally:
|
finally:
|
||||||
trigger_events(self._server_settings.get('before_stop', []),
|
|
||||||
self.loop)
|
|
||||||
self.loop.close()
|
|
||||||
trigger_events(self._server_settings.get('after_stop', []),
|
trigger_events(self._server_settings.get('after_stop', []),
|
||||||
self.loop)
|
self.loop)
|
||||||
|
self.loop.close()
|
||||||
|
|
||||||
async def close(self):
|
async def close(self):
|
||||||
|
trigger_events(self._server_settings.get('before_stop', []),
|
||||||
|
self.loop)
|
||||||
if self.servers:
|
if self.servers:
|
||||||
# stop accepting connections
|
# stop accepting connections
|
||||||
self.log.info("Stopping server: %s, connections: %s",
|
self.log.info("Stopping server: %s, connections: %s",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user