projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '20183-update-priority-thread'
[arvados.git]
/
services
/
api
/
app
/
models
/
container_request.rb
diff --git
a/services/api/app/models/container_request.rb
b/services/api/app/models/container_request.rb
index ae50f557485c6a284303820fffc548b49108f829..09da141eae67e3cab6f8d964f819d6fd26cad017 100644
(file)
--- 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?
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
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)
# 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(
manifest = dst.manifest_text
log_coll.assign_attributes(