Fix before_stop event
This commit is contained in:
parent
d1fb5bdc30
commit
1396ca903d
|
@ -64,6 +64,9 @@ class GunicornWorker(base.Worker):
|
|||
trigger_events(self._server_settings.get('after_start', []),
|
||||
self.loop)
|
||||
self.loop.run_until_complete(self._check_alive())
|
||||
trigger_events(self._server_settings.get('before_stop', []),
|
||||
self.loop)
|
||||
self.loop.run_until_complete(self.close())
|
||||
finally:
|
||||
trigger_events(self._server_settings.get('after_stop', []),
|
||||
self.loop)
|
||||
|
@ -72,8 +75,6 @@ class GunicornWorker(base.Worker):
|
|||
sys.exit(self.exit_code)
|
||||
|
||||
async def close(self):
|
||||
trigger_events(self._server_settings.get('before_stop', []),
|
||||
self.loop)
|
||||
if self.servers:
|
||||
# stop accepting connections
|
||||
self.log.info("Stopping server: %s, connections: %s",
|
||||
|
@ -115,8 +116,6 @@ class GunicornWorker(base.Worker):
|
|||
except (Exception, BaseException, GeneratorExit, KeyboardInterrupt):
|
||||
pass
|
||||
|
||||
await self.close()
|
||||
|
||||
@staticmethod
|
||||
def _create_ssl_context(cfg):
|
||||
""" Creates SSLContext instance for usage in asyncio.create_server.
|
||||
|
|
Loading…
Reference in New Issue
Block a user