Only display MOTD in ASGI on startup (#2349)

This commit is contained in:
Adam Hopkins 2022-01-06 11:22:57 +02:00 committed by GitHub
parent a23547d73b
commit 313f97ac77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1728,7 +1728,8 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta):
details: https://asgi.readthedocs.io/en/latest
"""
self.asgi = True
self.motd("")
if scope["type"] == "lifespan":
self.motd("")
self._asgi_app = await ASGIApp.create(self, scope, receive, send)
asgi_app = self._asgi_app
await asgi_app()