mirror of
https://github.com/home-assistant/core.git
synced 2025-08-11 00:25:12 +02:00
Avoid many hass.is_stopping calls in the discovery helper (#99929)
async_has_matching_flow is more likely to be True than hass.is_stopping This does not make much difference but it was adding noise to a profile that I am digging into to look for another issue
This commit is contained in:
@@ -44,8 +44,9 @@ def _async_init_flow(
|
|||||||
# as ones in progress as it may cause additional device probing
|
# as ones in progress as it may cause additional device probing
|
||||||
# which can overload devices since zeroconf/ssdp updates can happen
|
# which can overload devices since zeroconf/ssdp updates can happen
|
||||||
# multiple times in the same minute
|
# multiple times in the same minute
|
||||||
if hass.is_stopping or hass.config_entries.flow.async_has_matching_flow(
|
if (
|
||||||
domain, context, data
|
hass.config_entries.flow.async_has_matching_flow(domain, context, data)
|
||||||
|
or hass.is_stopping
|
||||||
):
|
):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user