diff --git a/assemblyline_service_client/task_handler.py b/assemblyline_service_client/task_handler.py index 9f62b04..a6e369f 100644 --- a/assemblyline_service_client/task_handler.py +++ b/assemblyline_service_client/task_handler.py @@ -204,11 +204,11 @@ def request_with_retries(self, method: str, url: str, get_api_response=True, max else: return resp except requests.ConnectionError: - msg = "Cannot reach service server..." - if retry < 2: - self.log.info(msg) - else: - self.log.warning(msg) + if not retry: + self.log.info("Service server is unreachable...") + elif retry % 10 == 0: + self.log.warning(f"Service server has been unreachable for the past {retry} attempts. " + "Is there something wrong with it?") except requests.Timeout: # Handles ConnectTimeout and ReadTimeout pass except requests.HTTPError as e: