Move loop setup to after startup debug messages

This commit is contained in:
Néstor Pérez 2021-11-02 16:22:29 +01:00 committed by GitHub
parent 5ca22d7a40
commit 934d737a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1304,13 +1304,6 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta):
else BASE_LOGO
)
if not isinstance(loop, AbstractEventLoop):
if self.config.USE_UVLOOP:
use_uvloop()
if loop is True:
loop = get_event_loop()
# Serve
if host and port:
proto = "http"
@ -1328,6 +1321,13 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta):
logger.debug(f"Sanic auto-reload: {reload_mode}")
logger.debug(f"Sanic debug mode: {debug_mode}")
if not isinstance(loop, AbstractEventLoop):
if self.config.USE_UVLOOP:
use_uvloop()
if loop is True:
loop = get_event_loop()
ssl = process_to_context(ssl)
server_settings = {