diff --git a/sanic/app.py b/sanic/app.py index 1704aa67..5d1e5547 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -206,7 +206,7 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta): if self.config.REGISTER: self.__class__.register_app(self) - if self.config.USE_UVLOOP: + if not self.config.NO_UVLOOP: use_uvloop() self.router.ctx.app = self diff --git a/sanic/config.py b/sanic/config.py index 3a7c280a..310a289b 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -27,6 +27,7 @@ DEFAULT_CONFIG = { "GRACEFUL_SHUTDOWN_TIMEOUT": 15.0, # 15 sec "KEEP_ALIVE_TIMEOUT": 5, # 5 seconds "KEEP_ALIVE": True, + "NO_UVLOOP": False, "PROXIES_COUNT": None, "REAL_IP_HEADER": None, "REGISTER": True, @@ -36,7 +37,6 @@ DEFAULT_CONFIG = { "REQUEST_MAX_SIZE": 100000000, # 100 megabytes "REQUEST_TIMEOUT": 60, # 60 seconds "RESPONSE_TIMEOUT": 60, # 60 seconds - "USE_UVLOOP": True, "WEBSOCKET_MAX_SIZE": 2 ** 20, # 1 megabyte "WEBSOCKET_PING_INTERVAL": 20, "WEBSOCKET_PING_TIMEOUT": 20, @@ -52,6 +52,7 @@ class Config(dict): GRACEFUL_SHUTDOWN_TIMEOUT: float KEEP_ALIVE_TIMEOUT: int KEEP_ALIVE: bool + NO_UVLOOP: bool PROXIES_COUNT: Optional[int] REAL_IP_HEADER: Optional[str] REGISTER: bool @@ -62,7 +63,6 @@ class Config(dict): REQUEST_TIMEOUT: int RESPONSE_TIMEOUT: int SERVER_NAME: str - USE_UVLOOP: bool WEBSOCKET_MAX_SIZE: int WEBSOCKET_PING_INTERVAL: int WEBSOCKET_PING_TIMEOUT: int