X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/79e53c0eed77396cb37f60b48be0c60fe7e0ab89..c820bfc91be7635739bad0857ba3a385d1334b6a:/services/api/lib/crunch_dispatch.rb diff --git a/services/api/lib/crunch_dispatch.rb b/services/api/lib/crunch_dispatch.rb index 7c9fa0a253..bea1657de2 100644 --- a/services/api/lib/crunch_dispatch.rb +++ b/services/api/lib/crunch_dispatch.rb @@ -963,10 +963,11 @@ class CrunchDispatch # An array of job_uuids in squeue def squeue_jobs if Rails.configuration.crunch_job_wrapper == :slurm_immediate - IO.popen(['squeue', '-a', '-h', '-o', '%j']) do |squeue_pipe| - squeue_pipe.readlines.map do |line| - line.strip - end + p = IO.popen(['squeue', '-a', '-h', '-o', '%j']) + begin + p.readlines.map {|line| line.strip} + ensure + p.close end else []