From 313f97ac77f4dd9a32670086f74e24ae40f5abe5 Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Thu, 6 Jan 2022 11:22:57 +0200 Subject: [PATCH] Only display MOTD in ASGI on startup (#2349) --- sanic/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/app.py b/sanic/app.py index ec35ee77..97c7a177 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -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()