From 934d737a923fb8431dfdf91416be906afbee5626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20P=C3=A9rez?= <25409753+prryplatypus@users.noreply.github.com> Date: Tue, 2 Nov 2021 16:22:29 +0100 Subject: [PATCH] Move loop setup to after startup debug messages --- sanic/app.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index 23b21ff6..59150d73 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -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" @@ -1327,6 +1320,13 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta): reload_mode = "enabled" if auto_reload else "disabled" 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)