Skip to content

Commit

Permalink
catch HTTP error in classify w/ exp. backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
pmhalvor committed Oct 21, 2024
1 parent 77d5469 commit 76f532f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/stages/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,11 @@ def process(self, element):
logging.info(f"Retrying in {wait*wait} seconds.")
wait += 1
time.sleep(wait*wait)
except requests.exceptions.HTTPError as e:
logging.error(f"HTTP error: {e}")
logging.error(f"Retrying in {wait*wait} seconds.")
wait += 1
time.sleep(wait*wait)

response = requests.post(self.inference_url, json=data)
response.raise_for_status()
Expand Down

0 comments on commit 76f532f

Please sign in to comment.