[ARVADOS] updated: 1d135e43d06148b100fbc8534144b405e4824af9

git at public.curoverse.com git at public.curoverse.com
Thu Sep 25 15:24:58 EDT 2014


Summary of changes:
 apps/workbench/app/models/job.rb | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

       via  1d135e43d06148b100fbc8534144b405e4824af9 (commit)
      from  2861857a87d4c40924f783862ee09e91cec0b96f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 1d135e43d06148b100fbc8534144b405e4824af9
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Sep 25 15:24:52 2014 -0400

    3988: Add note to Job.state.  Replace logic to compute state based on
    success/running columns with the same logic as used on apiserver.

diff --git a/apps/workbench/app/models/job.rb b/apps/workbench/app/models/job.rb
index d3d38b0..f933c07 100644
--- a/apps/workbench/app/models/job.rb
+++ b/apps/workbench/app/models/job.rb
@@ -46,20 +46,23 @@ class Job < ArvadosBase
     arvados_api_client.unpack_api_response arvados_api_client.api("jobs/", "queue", {"_method"=> "GET"})
   end
 
+  # The 'job' parameter can be either a Job model object, or a hash containing
+  # the same fields as a Job object (such as the :job entry of a pipeline
+  # component).
   def self.state job
+    # This has a valid state method on it so call that
     if job.respond_to? :state and job.state
       return job.state
     end
 
-    if not job[:cancelled_at].nil?
+    # Figure out the state based on the other fields.
+    if job[:cancelled_at]
       "Cancelled"
-    elsif not job[:finished_at].nil? or not job[:success].nil?
-      if job[:success]
-        "Completed"
-      else
-        "Failed"
-      end
-    elsif job[:running]
+    elsif job[:success] == false
+      "Failed"
+    elsif job[:success] == true
+      "Complete"
+    elsif job[:running] == true
       "Running"
     else
       "Queued"

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list