Skip to content

Commit

Permalink
Merge pull request #10 from CybercentreCanada/hotfix/empty_file
Browse files Browse the repository at this point in the history
Less aggressive warning logs when service server is unreacheable
  • Loading branch information
cccs-sgaron authored May 31, 2021
2 parents 29452ce + b699652 commit b5b430d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions assemblyline_service_client/task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b5b430d

Please sign in to comment.