Replace USE_UVLOOP with NO_UVLOOP for consistency

This commit is contained in:
prryplatypus 2021-10-03 20:51:32 +02:00
parent 283911d0b2
commit 1a034fc9c4
No known key found for this signature in database
GPG Key ID: 6687E128FB70819B
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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