From 4cf67a4bb90d3342edc322775f9591b19eb05953 Mon Sep 17 00:00:00 2001 From: 1maple1 <160027655+1maple1@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:14:33 +0000 Subject: [PATCH] Add wait for plugin backoff --- brewtils/plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/brewtils/plugin.py b/brewtils/plugin.py index b6bd0bd4..eb385c26 100644 --- a/brewtils/plugin.py +++ b/brewtils/plugin.py @@ -389,13 +389,13 @@ def get_system_dependency(self, require, timeout=300): and any("RUNNING" == instance.status for instance in system.instances) ): return system - self._wait() self.logger.error( f"Waiting {wait_time:.1f} seconds before next attempt for {self._system} " f"dependency for {require}" ) timeout = timeout - wait_time wait_time = min(wait_time * 2, 30) + self._wait(wait_time) raise PluginValidationError( f"Failed to resolve {self._system} dependency for {require}" @@ -688,12 +688,13 @@ def _start(self): self._instance.id, new_status="RUNNING" ) - def _wait(self): + def _wait(self, timeout): """Handle wait request""" # Set the status to wait self._instance = self._ez_client.update_instance( self._instance.id, new_status="AWAITING_SYSTEM" ) + self._shutdown_event.wait(timeout) def _stop(self): """Handle stop Request"""