X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/05c87aaf4572a6420a61e16495420e99ece2cef6..5338c3fe0abbc6599aa290085be13eecfb0044e9:/apps/workbench/app/controllers/container_requests_controller.rb diff --git a/apps/workbench/app/controllers/container_requests_controller.rb b/apps/workbench/app/controllers/container_requests_controller.rb index 587819dd44..8ce068198e 100644 --- a/apps/workbench/app/controllers/container_requests_controller.rb +++ b/apps/workbench/app/controllers/container_requests_controller.rb @@ -20,7 +20,7 @@ class ContainerRequestsController < ApplicationController # Search for child CRs if cr[:container_uuid] - child_crs = ContainerRequest.where(requesting_container_uuid: cr[:container_uuid]) + child_crs = ContainerRequest.where(requesting_container_uuid: cr[:container_uuid]).with_count("none") child_crs.each do |child| nodes[child[:uuid]] = child @@ -38,14 +38,14 @@ class ContainerRequestsController < ApplicationController # Batch requests to get all related collections # First fetch output collections by UUID. - Collection.filter([['uuid', 'in', col_uuids.uniq]]).each do |c| + Collection.filter([['uuid', 'in', col_uuids.uniq]]).with_count("none").each do |c| output_pdhs << c[:portable_data_hash] pdh_to_col[c[:portable_data_hash]] = c nodes[c[:uuid]] = c end # Next, get input collections by PDH. Collection.filter( - [['portable_data_hash', 'in', col_pdhs - output_pdhs]]).each do |c| + [['portable_data_hash', 'in', col_pdhs - output_pdhs]]).with_count("none").each do |c| nodes[c[:portable_data_hash]] = c end @@ -73,7 +73,7 @@ class ContainerRequestsController < ApplicationController def cancel if @object.container_uuid - c = Container.select(['state']).where(uuid: @object.container_uuid).first + c = Container.select(['state']).where(uuid: @object.container_uuid).with_count("none").first if c && c.state != 'Running' # If the container hasn't started yet, setting priority=0 # leaves our request in "Committed" state and doesn't cancel