[arvados] updated: 2.5.0-264-g85613a878

git repository hosting git at public.arvados.org
Fri Mar 10 14:30:52 UTC 2023


Summary of changes:
 services/api/app/models/container_request.rb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

       via  85613a8782524a5693ba306ff0ef6da0deecfb20 (commit)
      from  1ba4c76f70f0f3d68e01fc548b0b7de0d43723ca (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 85613a8782524a5693ba306ff0ef6da0deecfb20
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Mar 10 09:29:34 2023 -0500

    20223: Use pluck to avoid loading full record just to get log
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index ae50f5574..09da141ea 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -352,10 +352,11 @@ class ContainerRequest < ArvadosModel
       self.container_count += 1
       return if self.container_uuid_was.nil?
 
-      old_container = Container.find_by_uuid(self.container_uuid_was)
-      return if old_container.nil?
+      old_container_uuid = self.container_uuid_was
+      old_container_log = Container.where(uuid: old_container_uuid).pluck(:log).first
+      return if old_container_log.nil?
 
-      old_logs = Collection.where(portable_data_hash: old_container.log).first
+      old_logs = Collection.where(portable_data_hash: old_container_log).first
       return if old_logs.nil?
 
       log_coll = self.log_uuid.nil? ? nil : Collection.where(uuid: self.log_uuid).first
@@ -370,7 +371,7 @@ class ContainerRequest < ArvadosModel
       # copy logs from old container into CR's log collection
       src = Arv::Collection.new(old_logs.manifest_text)
       dst = Arv::Collection.new(log_coll.manifest_text)
-      dst.cp_r("./", "log for container #{old_container.uuid}", src)
+      dst.cp_r("./", "log for container #{old_container_uuid}", src)
       manifest = dst.manifest_text
 
       log_coll.assign_attributes(

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list