Lifespan and code cleanup

This commit is contained in:
Adam Hopkins
2019-06-04 10:58:00 +03:00
parent aebe2b5809
commit 3685b4de85
16 changed files with 924 additions and 179 deletions

View File

@@ -54,7 +54,7 @@ class Sanic:
logging.config.dictConfig(log_config or LOGGING_CONFIG_DEFAULTS)
self.name = name
self.asgi = True
self.asgi = False
self.router = router or Router()
self.request_class = request_class
self.error_handler = error_handler or ErrorHandler()
@@ -1393,5 +1393,6 @@ class Sanic:
# -------------------------------------------------------------------- #
async def __call__(self, scope, receive, send):
self.asgi = True
asgi_app = await ASGIApp.create(self, scope, receive, send)
await asgi_app()