Simplify watchdog container rules (#3820)

This commit is contained in:
Pascal Vizeli 2022-08-25 21:20:14 +02:00 committed by GitHub
parent 97af1fc66e
commit 7b63544474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -963,10 +963,11 @@ class Addon(AddonModel):
async def watchdog_container(self, event: DockerContainerStateEvent) -> None: async def watchdog_container(self, event: DockerContainerStateEvent) -> None:
"""Process state changes in addon container and restart if necessary.""" """Process state changes in addon container and restart if necessary."""
if ( if event.name != self.instance.name:
not (event.name == self.instance.name and self.watchdog) return
or self._manual_stop
): # Skip watchdog if not enabled or manual stopped
if not self.watchdog or self._manual_stop:
return return
if event.state in [ if event.state in [