Skip to content

Commit

Permalink
improved cancel handling and setting steps status
Browse files Browse the repository at this point in the history
  • Loading branch information
godfryd committed Nov 15, 2023
1 parent f8a534c commit c0d36f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/kraken/server/exec_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def cancel_job(job, note, cmplt_status):
job.completion_status = cmplt_status
job.notes = note
job.finished = utils.utcnow()
for s in job.steps:
if s.status == consts.STEP_STATUS_IN_PROGRES:
s.status = consts.STEP_STATUS_ERROR
elif s.status == consts.STEP_STATUS_NOT_STARTED or s.status is None:
s.status = consts.STEP_STATUS_SKIPPED
db.session.commit()
kkrq.enq(bg_jobs.job_completed, job.id)
log.info('job %s canceled because: %s', job, note, job=job.id)
Expand Down

0 comments on commit c0d36f2

Please sign in to comment.