Skip to content

Commit

Permalink
account for when there is not yet failed status
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-iohk committed Jun 7, 2024
1 parent a288d6a commit fb59933
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions uptime_service_validation/coordinator/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +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 < 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)
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 fb59933

Please sign in to comment.