Skip to content

Commit

Permalink
Merge pull request #57 from MinaFoundation/stop-after-all-retries2
Browse files Browse the repository at this point in the history
PM-1726 retry and exit using statuses
  • Loading branch information
piotr-iohk authored Jun 7, 2024
2 parents 0b44774 + fb59933 commit 404a886
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions uptime_service_validation/coordinator/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,17 @@ def setUpValidatorPods(time_intervals, logging, worker_image, worker_tag):
if job_status.status.succeeded:
logging.info(f"Job {job_name} succeeded.")
jobs.remove(job_name)
elif job_status.status.failed:
logging.error(f"Job {job_name} failed.")
jobs.remove(job_name)
elif job_status.status.failed is not None:
if job_status.status.failed < Config.RETRY_COUNT:
logging.warning(
f"Job {job_name} failed. Retrying attempt {job_status.status.failed}/{Config.RETRY_COUNT}..."
)
else:
logging.error(
f"Job {job_name} failed. Maximum retries ({Config.RETRY_COUNT}) reached. Exiting the program..."
)
jobs.remove(job_name)
exit(1)
except Exception as e:
logging.error(f"Error reading job status for {job_name}: {e}")

Expand Down

0 comments on commit 404a886

Please sign in to comment.