[arvados] updated: 2.5.0-269-gaf90b8e12
git repository hosting
git at public.arvados.org
Fri Mar 10 18:53:11 UTC 2023
Summary of changes:
.../controllers/arvados/v1/collections_controller.rb | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
via af90b8e123e227fe2c35902e3a80f49b15e6d067 (commit)
from effb6e13d6a4d024243138cacfeb582efba5e24a (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 af90b8e123e227fe2c35902e3a80f49b15e6d067
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri Mar 10 13:52:51 2023 -0500
20223: Even more efficient to use pluck instead of batches
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb
index 225c05462..ad1771a87 100644
--- a/services/api/app/controllers/arvados/v1/collections_controller.rb
+++ b/services/api/app/controllers/arvados/v1/collections_controller.rb
@@ -183,12 +183,12 @@ class Arvados::V1::CollectionsController < ApplicationController
end
end
- Container.readable_by(*@read_users).where(output: loc.to_s).in_batches(of: 15).each_record do |c|
- search_edges(visited, c.uuid, :search_up)
+ Container.readable_by(*@read_users).where(output: loc.to_s).pluck(:uuid).each do |c_uuid|
+ search_edges(visited, c_uuid, :search_up)
end
- Container.readable_by(*@read_users).where(log: loc.to_s).in_batches(of: 15).each_record do |c|
- search_edges(visited, c.uuid, :search_up)
+ Container.readable_by(*@read_users).where(log: loc.to_s).pluck(:uuid).each do |c_uuid|
+ search_edges(visited, c_uuid, :search_up)
end
elsif direction == :search_down
if loc.to_s == "d41d8cd98f00b204e9800998ecf8427e+0"
@@ -207,7 +207,7 @@ class Arvados::V1::CollectionsController < ApplicationController
end
end
- Container.readable_by(*@read_users).where([Container.full_text_trgm + " like ?", "%#{loc.to_s}%"]).in_batches(of: 15).each_record do |c|
+ Container.readable_by(*@read_users).where([Container.full_text_trgm + " like ?", "%#{loc.to_s}%"]).select("output, log, uuid").each do |c|
if c.output != loc.to_s && c.log != loc.to_s
search_edges(visited, c.uuid, :search_down)
end
@@ -276,12 +276,12 @@ class Arvados::V1::CollectionsController < ApplicationController
end
end
- ContainerRequest.readable_by(*@read_users).where(output_uuid: uuid).in_batches(of: 15).each_record do |cr|
- search_edges(visited, cr.uuid, :search_up)
+ ContainerRequest.readable_by(*@read_users).where(output_uuid: uuid).pluck(:uuid).each do |cr_uuid|
+ search_edges(visited, cr_uuid, :search_up)
end
- ContainerRequest.readable_by(*@read_users).where(log_uuid: uuid).in_batches(of: 15).each_record do |cr|
- search_edges(visited, cr.uuid, :search_up)
+ ContainerRequest.readable_by(*@read_users).where(log_uuid: uuid).pluck(:uuid).each do |cr_uuid|
+ search_edges(visited, cr_uuid, :search_up)
end
elsif direction == :search_down
search_edges(visited, c.portable_data_hash, :search_down)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list