Skip to content

Commit

Permalink
Merge pull request #18 from telekom-mms/retries
Browse files Browse the repository at this point in the history
add retry-logic
  • Loading branch information
rndmh3ro authored Nov 2, 2023
2 parents 149fc86 + 18dd4d2 commit 50eb81f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ def send_to_dojo(body, meta, logger, **_):
response.raise_for_status()
except HTTPError as http_err:
c.labels("failed").inc()
raise kopf.PermanentError(
f"HTTP error occurred: {http_err} - {response.content}"
raise kopf.TemporaryError(
f"HTTP error occurred: {http_err} - {response.content}. Retrying in 60 seconds", delay=60
)
except Exception as err:
c.labels("failed").inc()
raise kopf.PermanentError(f"Other error occurred: {err}")
raise kopf.TemporaryError(f"Other error occurred: {err}. Retrying in 60 seconds", delay=60)
else:
c.labels("success").inc()
logger.info(f"Finished {meta['name']}")
Expand Down

0 comments on commit 50eb81f

Please sign in to comment.