Skip to content

Commit

Permalink
Merge pull request #657 from opensafely-core/madwort/rerun-failed-by-…
Browse files Browse the repository at this point in the history
…default

fix: re-run failed jobs by default when required
  • Loading branch information
bloodearnest authored Sep 19, 2023
2 parents 5766795 + 45b5084 commit 059468b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions jobrunner/create_or_update_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,9 @@ def job_should_be_rerun(job_request, job):
# Otherwise if it succeeded last time there's no need to run again
if job.state == State.SUCCEEDED:
return False
# If it failed last time ...
# If it failed last time, re-run it by default
elif job.state == State.FAILED:
# ... and we're forcing failed jobs to re-run then re-run it
if job_request.force_run_failed:
return True
# Otherwise it's an error condition
raise JobRequestError(
f"{job.action} failed on a previous run and must be re-run"
)
return True
else:
raise ValueError(f"Invalid state: {job}")

Expand Down

0 comments on commit 059468b

Please sign in to comment.