mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 13:27:09 +00:00
Create tasks eagerly in the discovery flow helper (#111557)
The likely outcome from most discoveries is an near immediate abort so we run them eagerly to avoid having to schedule on the event loop for the common case
This commit is contained in:
parent
b75277cc24
commit
ae2ce99cbd
@ -29,7 +29,9 @@ def async_create_flow(
|
||||
|
||||
if not dispatcher or dispatcher.started:
|
||||
if init_coro := _async_init_flow(hass, domain, context, data):
|
||||
hass.async_create_task(init_coro, f"discovery flow {domain} {context}")
|
||||
hass.async_create_task(
|
||||
init_coro, f"discovery flow {domain} {context}", eager_start=True
|
||||
)
|
||||
return
|
||||
|
||||
return dispatcher.async_create(domain, context, data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user