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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue