diff --git a/sanic/config.py b/sanic/config.py index 075bc47d..2d24098c 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -127,7 +127,7 @@ class Config(dict): self.KEEP_ALIVE = keep_alive self.WEBSOCKET_MAX_SIZE = 2 ** 20 # 1 megabytes self.WEBSOCKET_MAX_QUEUE = 32 - self.GRACEFUL_SHUTDOWN_TIMEOUT = 15.0 # 15 sec + self.GRACEFUL_SHUTDOWN_TIMEOUT = 15.0 # 15 sec if load_env: self.load_environment_vars() diff --git a/sanic/server.py b/sanic/server.py index 7ceef655..f4babb89 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -403,7 +403,8 @@ def serve(host, port, request_handler, error_handler, before_start=None, register_sys_signals=True, run_async=False, connections=None, signal=Signal(), request_class=None, has_log=True, keep_alive=True, is_request_stream=False, router=None, websocket_max_size=None, - websocket_max_queue=None, state=None, graceful_shutdown_timeout=15.0): + websocket_max_queue=None, state=None, + graceful_shutdown_timeout=15.0): """Start asynchronous HTTP Server on an individual process. :param host: Address to host on diff --git a/sanic/worker.py b/sanic/worker.py index 3adef65f..7c02053c 100644 --- a/sanic/worker.py +++ b/sanic/worker.py @@ -94,7 +94,8 @@ class GunicornWorker(base.Worker): # gracefully shutdown timeout start_shutdown = 0 graceful_shutdown_timeout = self.cfg.graceful_timeout - while self.connections and (start_shutdown < graceful_shutdown_timeout): + while self.connections and \ + (start_shutdown < graceful_shutdown_timeout): await asyncio.sleep(0.1) start_shutdown = start_shutdown + 0.1 @@ -109,7 +110,6 @@ class GunicornWorker(base.Worker): _shutdown = asyncio.gather(*coros, loop=self.loop) await _shutdown - async def _run(self): for sock in self.sockets: state = dict(requests_count=0)