1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 05:57:01 +00:00

Add a message to the config entry cancel call (#96925)

This commit is contained in:
J. Nick Koston
2023-07-19 19:22:38 -05:00
committed by GitHub
parent 955bed0128
commit 6bb81b862c

View File

@@ -692,8 +692,9 @@ class ConfigEntry:
if not self._tasks and not self._background_tasks:
return
cancel_message = f"Config entry {self.title} with {self.domain} unloading"
for task in self._background_tasks:
task.cancel()
task.cancel(cancel_message)
_, pending = await asyncio.wait(
[*self._tasks, *self._background_tasks], timeout=10
@@ -885,7 +886,9 @@ class ConfigEntriesFlowManager(data_entry_flow.FlowManager):
"""Cancel any initializing flows."""
for task_list in self._initialize_tasks.values():
for task in task_list:
task.cancel()
task.cancel(
"Config entry initialize canceled: Home Assistant is shutting down"
)
await self._discovery_debouncer.async_shutdown()
async def async_finish_flow(