X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ed8493bae19f584ef04952a81db195b57320189f..4baccff09d5f8c48cc3c431365f1e029a8c40bb1:/services/api/script/crunch-dispatch.rb?ds=inline diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb index a54e8acf72..6df9a19d29 100755 --- a/services/api/script/crunch-dispatch.rb +++ b/services/api/script/crunch-dispatch.rb @@ -310,11 +310,11 @@ class Dispatcher jobrecord = Job.find_by_uuid(job_done.uuid) jobrecord.running = false - if jobrecord.finished_at == nil - jobrecord.finished_at = Time.now - end + jobrecord.finished_at ||= Time.now + # Don't set 'jobrecord.success = false' because if the job failed to run due to an + # issue with crunch-job or slurm, we want the job to stay in the queue. jobrecord.save! - + # Invalidate the per-job auth token j_done[:job_auth].update_attributes expires_at: Time.now @@ -368,8 +368,6 @@ class Dispatcher end end - - protected def did_recently(thing, min_interval)