Pre-import api, config, and lovelace in bootstrap to avoid loading them at runtime (#111752)
parent
feea4071d0
commit
acfd1c2755
|
@ -18,7 +18,18 @@ import voluptuous as vol
|
||||||
import yarl
|
import yarl
|
||||||
|
|
||||||
from . import config as conf_util, config_entries, core, loader, requirements
|
from . import config as conf_util, config_entries, core, loader, requirements
|
||||||
from .components import http
|
|
||||||
|
# Pre-import config and lovelace which have no requirements here to avoid
|
||||||
|
# loading them at run time and blocking the event loop. We do this ahead
|
||||||
|
# of time so that we do not have to flag frontends deps with `import_executor`
|
||||||
|
# as it would create a thundering heard of executor jobs trying to import
|
||||||
|
# frontend deps at the same time.
|
||||||
|
from .components import (
|
||||||
|
api as api_pre_import, # noqa: F401
|
||||||
|
config as config_pre_import, # noqa: F401
|
||||||
|
http,
|
||||||
|
lovelace as lovelace_pre_import, # noqa: F401
|
||||||
|
)
|
||||||
from .const import (
|
from .const import (
|
||||||
FORMAT_DATETIME,
|
FORMAT_DATETIME,
|
||||||
REQUIRED_NEXT_PYTHON_HA_RELEASE,
|
REQUIRED_NEXT_PYTHON_HA_RELEASE,
|
||||||
|
|
Loading…
Reference in New Issue