Retry on more Plex connection failures during startup (#69822)

This commit is contained in:
jjlawren
2022-04-10 22:59:21 -07:00
committed by Paulus Schoutsen
parent 8e3e6efb21
commit 02eec73644
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -159,7 +159,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry.data[CONF_SERVER],
error,
)
return False
# Retry as setups behind a proxy can return transient 404 or 502 errors
raise ConfigEntryNotReady from error
_LOGGER.debug(
"Connected to: %s (%s)", plex_server.friendly_name, plex_server.url_in_use
+1 -1
View File
@@ -63,7 +63,7 @@ async def test_setup_config_entry_with_error(hass, entry):
await hass.async_block_till_done()
assert len(hass.config_entries.async_entries(const.DOMAIN)) == 1
assert entry.state is ConfigEntryState.SETUP_ERROR
assert entry.state is ConfigEntryState.SETUP_RETRY
async def test_setup_with_insecure_config_entry(hass, entry, setup_plex_server):