1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add cancel messages to core task cancelation (#96972)

This commit is contained in:
J. Nick Koston
2023-07-20 18:03:36 -05:00
committed by GitHub
parent 6818cae072
commit 99def97ed9
3 changed files with 5 additions and 5 deletions

View File

@@ -764,7 +764,7 @@ class HomeAssistant:
for task in self._background_tasks:
self._tasks.add(task)
task.add_done_callback(self._tasks.remove)
task.cancel()
task.cancel("Home Assistant is stopping")
self._cancel_cancellable_timers()
self.exit_code = exit_code
@@ -814,7 +814,7 @@ class HomeAssistant:
"the stop event to prevent delaying shutdown",
task,
)
task.cancel()
task.cancel("Home Assistant stage 2 shutdown")
try:
async with async_timeout.timeout(0.1):
await task