Skip to content

Commit

Permalink
HC-546: Update retry job to move failed job back to job_status index …
Browse files Browse the repository at this point in the history
…if retried (#34)

* HC-546: Move from job_failed to job_status index

* Make sure to move to current day job_status

---------

Co-authored-by: Mike Cayanan <[email protected]>
  • Loading branch information
mcayanan and Mike Cayanan authored Oct 9, 2024
1 parent 6026de5 commit 51d703f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ def resubmit_jobs(context):
# delete old job status
delete_by_id(index, _id)

# Before re-queueing, check to see if the job was under the job_failed index. If so, need to
# move it back to job_status
if index.startswith("job_failed"):
current_time = datetime.utcnow()
job_json['job_info']['index'] = f"job_status-{current_time.strftime('%Y.%m.%d')}"

# log queued status
job_status_json = {
'uuid': new_task_id,
Expand Down

0 comments on commit 51d703f

Please sign in to comment.