Skip to content

Commit

Permalink
suppress list exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed May 29, 2024
1 parent 0da77dd commit d20beb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/main/ruby/lib/merritt_zk_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def self.list_jobs_as_json(zk)
jobjson[:queueNode] = Access.dir(queue)
jobjson[:path] = job.path
jobs.append(jobjson)
rescue StandardError => e
puts "List Access #{cp} exception: #{e}"
end
end
jobs
Expand Down
16 changes: 10 additions & 6 deletions src/main/ruby/lib/merritt_zk_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,16 @@ def self.list_jobs_as_json(zk)
zk.children(DIR).sort.each do |cp|
next if cp == ZkKeys::STATES

job = Job.new(cp).load(zk)
jobjson = job.data
jobjson[:id] = job.id
jobjson[:bid] = job.bid
jobjson[:status] = job.status_name
jobs.append(jobjson)
begin
job = Job.new(cp).load(zk)
jobjson = job.data
jobjson[:id] = job.id
jobjson[:bid] = job.bid
jobjson[:status] = job.status_name
jobs.append(jobjson)
rescue StandardError => e
puts "List Job #{cp} exception: #{e}"
end
end
jobs
end
Expand Down

0 comments on commit d20beb4

Please sign in to comment.