Make sure oid_login_perm exists when setup is executed for an existing user
[arvados.git] / services / api / script / crunch-dispatch.rb
index a54e8acf726c55e91d98f54874674988f02d80a4..9eb1c28cb2e3fa567a735f7b9556c57ba32e8f1f 100755 (executable)
@@ -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)