Run storage final write listener immediately (#114976)

This one should not need a call_soon
pull/114994/head
J. Nick Koston 2024-04-05 15:59:11 -10:00 committed by GitHub
parent c9ce848b4b
commit d25ac06326
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -479,7 +479,9 @@ class Store(Generic[_T]):
"""Ensure that we write if we quit before delay has passed."""
if self._unsub_final_write_listener is None:
self._unsub_final_write_listener = self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_FINAL_WRITE, self._async_callback_final_write
EVENT_HOMEASSISTANT_FINAL_WRITE,
self._async_callback_final_write,
run_immediately=True,
)
@callback