[ARVADOS] created: 1.2.0-93-g39c28fac9

Git user git at public.curoverse.com
Wed Sep 5 14:18:03 EDT 2018


        at  39c28fac9320fbee1cc8fc4e92c5e7cca03cccd6 (commit)


commit 39c28fac9320fbee1cc8fc4e92c5e7cca03cccd6
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Wed Sep 5 14:16:28 2018 -0400

    13973: Use a straightforward maximum() query to compute max priority
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index 470388a7c..f430ae918 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -361,11 +361,7 @@ class ContainerRequest < ArvadosModel
       self.requesting_container_uuid = c.uuid
       # Determine the priority of container request for the requesting
       # container.
-      self.priority = ContainerRequest.
-            where('container_uuid=? and priority>0', self.requesting_container_uuid).
-            map do |cr|
-        cr.priority
-      end.max || 0
+      self.priority = ContainerRequest.where(container_uuid: self.requesting_container_uuid).maximum("priority") || 0
     end
   end
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list