Prevent integrations from retrying setup once shutdown has started (#88818)

* Prevent integrations from retrying setup once shutdown has started

* coverage
This commit is contained in:
J. Nick Koston 2023-02-26 21:01:02 -06:00 committed by GitHub
parent 4898d22960
commit f8934175cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View file

@ -445,6 +445,10 @@ class ConfigEntry:
async def setup_again(*_: Any) -> None:
"""Run setup again."""
# Check again when we fire in case shutdown
# has started so we do not block shutdown
if hass.is_stopping:
return
self._async_cancel_retry_setup = None
await self.async_setup(hass, integration=integration, tries=tries)