Prevent updater from delaying startup (#35708)
* Prevent updater from delaying startup The updater sometimes times out as seen in #33833 and the linked issues. The issue was presenting again today as it appears the service is overloaded again. * s/hass.loop/asyncio/g
This commit is contained in:
parent
98523fbb61
commit
fca96799a0
2 changed files with 10 additions and 6 deletions
|
@ -1,4 +1,5 @@
|
|||
"""Support to check for available updates."""
|
||||
import asyncio
|
||||
from datetime import timedelta
|
||||
from distutils.version import StrictVersion
|
||||
import logging
|
||||
|
@ -105,7 +106,8 @@ async def async_setup(hass, config):
|
|||
update_interval=timedelta(days=1),
|
||||
)
|
||||
|
||||
await coordinator.async_refresh()
|
||||
# This can take up to 15s which can delay startup
|
||||
asyncio.create_task(coordinator.async_refresh())
|
||||
|
||||
hass.async_create_task(
|
||||
discovery.async_load_platform(hass, "binary_sensor", DOMAIN, {}, config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue