mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Dont cache integrations that are not found (#23316)
This commit is contained in:
parent
2a720efbd4
commit
72bbe2203e
@ -161,11 +161,13 @@ async def async_get_integration(hass: 'HomeAssistant', domain: str)\
|
||||
await int_or_evt.wait()
|
||||
int_or_evt = cache.get(domain, _UNDEF)
|
||||
|
||||
# When we have waited and it's _UNDEF, it doesn't exist
|
||||
# We don't cache that it doesn't exist, or else people can't fix it
|
||||
# and then restart, because their config will never be valid.
|
||||
if int_or_evt is _UNDEF:
|
||||
pass
|
||||
elif int_or_evt is None:
|
||||
raise IntegrationNotFound(domain)
|
||||
else:
|
||||
|
||||
if int_or_evt is not _UNDEF:
|
||||
return cast(Integration, int_or_evt)
|
||||
|
||||
event = cache[domain] = asyncio.Event()
|
||||
@ -197,7 +199,12 @@ async def async_get_integration(hass: 'HomeAssistant', domain: str)\
|
||||
return integration
|
||||
|
||||
integration = Integration.resolve_legacy(hass, domain)
|
||||
if integration is not None:
|
||||
cache[domain] = integration
|
||||
else:
|
||||
# Remove event from cache.
|
||||
cache.pop(domain)
|
||||
|
||||
event.set()
|
||||
|
||||
if not integration:
|
||||
|
Loading…
x
Reference in New Issue
Block a user