Skip to content

Commit

Permalink
Pre-import api, config, and lovelace in bootstrap to avoid loading th…
Browse files Browse the repository at this point in the history
…em at runtime (#111752)
  • Loading branch information
bdraco authored Feb 29, 2024
1 parent 943bd17 commit 9f8fbb7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@
import yarl

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 (
FORMAT_DATETIME,
KEY_DATA_LOGGING as DATA_LOGGING,
Expand Down

0 comments on commit 9f8fbb7

Please sign in to comment.