mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Limit executor jobs during custom_components load to match non-custom behavior (#49451)
This commit is contained in:
parent
f600649016
commit
3164eef059
@ -23,6 +23,7 @@ from homeassistant.generated.dhcp import DHCP
|
|||||||
from homeassistant.generated.mqtt import MQTT
|
from homeassistant.generated.mqtt import MQTT
|
||||||
from homeassistant.generated.ssdp import SSDP
|
from homeassistant.generated.ssdp import SSDP
|
||||||
from homeassistant.generated.zeroconf import HOMEKIT, ZEROCONF
|
from homeassistant.generated.zeroconf import HOMEKIT, ZEROCONF
|
||||||
|
from homeassistant.util.async_ import gather_with_concurrency
|
||||||
|
|
||||||
# Typing imports that create a circular dependency
|
# Typing imports that create a circular dependency
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@ -128,13 +129,14 @@ async def _async_get_custom_components(
|
|||||||
get_sub_directories, custom_components.__path__
|
get_sub_directories, custom_components.__path__
|
||||||
)
|
)
|
||||||
|
|
||||||
integrations = await asyncio.gather(
|
integrations = await gather_with_concurrency(
|
||||||
|
MAX_LOAD_CONCURRENTLY,
|
||||||
*(
|
*(
|
||||||
hass.async_add_executor_job(
|
hass.async_add_executor_job(
|
||||||
Integration.resolve_from_root, hass, custom_components, comp.name
|
Integration.resolve_from_root, hass, custom_components, comp.name
|
||||||
)
|
)
|
||||||
for comp in dirs
|
for comp in dirs
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user