Start and stop template cache watcher to run_immediately (#113644)

This commit is contained in:
J. Nick Koston 2024-03-17 08:16:26 -10:00 committed by GitHub
parent 68320b1278
commit 4d75940cd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,8 +209,12 @@ def async_setup(hass: HomeAssistant) -> bool:
cancel = async_track_time_interval(
hass, _async_adjust_lru_sizes, timedelta(minutes=10)
)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, _async_adjust_lru_sizes)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, callback(lambda _: cancel()))
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_START, _async_adjust_lru_sizes, run_immediately=True
)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, callback(lambda _: cancel()), run_immediately=True
)
return True