From 08b55939fbc5333a374846e6ec2bdfa1ac5ca70f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 13 Jun 2022 11:33:29 -1000 Subject: [PATCH] Avoid creating executor job in requirements if another call satisfied the requirement (#73451) --- homeassistant/requirements.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/requirements.py b/homeassistant/requirements.py index 9a8cd20983a..bd06cf61e4b 100644 --- a/homeassistant/requirements.py +++ b/homeassistant/requirements.py @@ -231,9 +231,9 @@ class RequirementsManager: async with self.pip_lock: # Recaculate missing again now that we have the lock - await self._async_process_requirements( - name, self._find_missing_requirements(requirements) - ) + missing = self._find_missing_requirements(requirements) + if missing: + await self._async_process_requirements(name, missing) def _find_missing_requirements(self, requirements: list[str]) -> list[str]: """Find requirements that are missing in the cache."""