From 446f560b5983f68437d7bee2eb4c56f1883e5bb9 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:59:23 +0100 Subject: [PATCH] Set aiohttp shutdown_timeout on AppRunner instead of TCPSite (#105973) --- homeassistant/components/http/__init__.py | 4 +++- homeassistant/components/http/web_runner.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index 449f00fb335..6bb0c154540 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -520,7 +520,9 @@ class HomeAssistantHTTP: # pylint: disable-next=protected-access self.app._router.freeze = lambda: None # type: ignore[method-assign] - self.runner = web.AppRunner(self.app, handler_cancellation=True) + self.runner = web.AppRunner( + self.app, handler_cancellation=True, shutdown_timeout=10 + ) await self.runner.setup() self.site = HomeAssistantTCPSite( diff --git a/homeassistant/components/http/web_runner.py b/homeassistant/components/http/web_runner.py index 6d03b874a64..5c0931b97ca 100644 --- a/homeassistant/components/http/web_runner.py +++ b/homeassistant/components/http/web_runner.py @@ -29,7 +29,6 @@ class HomeAssistantTCPSite(web.BaseSite): host: None | str | list[str], port: int, *, - shutdown_timeout: float = 10.0, ssl_context: SSLContext | None = None, backlog: int = 128, reuse_address: bool | None = None, @@ -38,7 +37,6 @@ class HomeAssistantTCPSite(web.BaseSite): """Initialize HomeAssistantTCPSite.""" super().__init__( runner, - shutdown_timeout=shutdown_timeout, ssl_context=ssl_context, backlog=backlog, )