4232: revert experimental change to using find? for each of the jobs in a pipeline...
authorPhil Hodgson <bitbucket@philhodgson.net>
Sat, 21 Feb 2015 09:16:31 +0000 (10:16 +0100)
committerPhil Hodgson <bitbucket@philhodgson.net>
Sat, 21 Feb 2015 09:21:53 +0000 (10:21 +0100)
apps/workbench/app/helpers/pipeline_instances_helper.rb
services/api/app/models/job.rb

index 07fda05c32ac4c9e07902722df45ee24436812f9..b0d5216efd1588069050d5b0d5aa371abc07492d 100644 (file)
@@ -89,8 +89,8 @@ module PipelineInstancesHelper
       c[:job][:uuid] if c.is_a?(Hash) and c[:job].is_a?(Hash)
     }.compact
     job = {}
-    jobuuids.each do |jobuuid|
-      job[jobuuid] = Job.find?(jobuuid)
+    Job.where(uuid: jobuuids).each do |j|
+      job[j[:uuid]] = j
     end
 
     object.components.each do |cname, c|
index 4cd25e6b6c4e5dae6ec9c0095ca56ff47954bf8c..934c7fa36a33dac791a4fcbf3b4cbd3d03096560 100644 (file)
@@ -193,24 +193,6 @@ class Job < ArvadosModel
     end
   end
 
-  # def dependencies
-  #   deps = {}
-  #   queue = self.script_parameters.values
-  #   while not queue.empty?
-  #     queue = queue.flatten.compact.collect do |v|
-  #       if v.is_a? Hash
-  #         v.values
-  #       elsif v.is_a? String
-  #         v.match(/^(([0-9a-f]{32})\b(\+[^,]+)?,?)*$/) do |locator|
-  #           deps[locator.to_s] = true
-  #         end
-  #         nil
-  #       end
-  #     end
-  #   end
-  #   deps.keys
-  # end
-
   def permission_to_update
     if is_locked_by_uuid_was and !(current_user and
                                    (current_user.uuid == is_locked_by_uuid_was or