diff --git a/sanic/server/protocols/base_protocol.py b/sanic/server/protocols/base_protocol.py index 2e8a115e..bf1b3c15 100644 --- a/sanic/server/protocols/base_protocol.py +++ b/sanic/server/protocols/base_protocol.py @@ -90,9 +90,8 @@ class SanicProtocol(asyncio.Protocol): if self.transport: self.transport.close() if timeout is None: - self.abort() - else: - self.loop.call_later(timeout, self.abort) + timeout = self.app.config.GRACEFUL_SHUTDOWN_TIMEOUT + self.loop.call_later(timeout, self.abort) def abort(self): """