Skip to content

Commit

Permalink
Handle an exception from target.perf_capture_queue
Browse files Browse the repository at this point in the history
Prevent a single target.perf_capture_queue exception from preventing the
rest of the targets from being queued.  If an invalid target made its
way into the targets list and perf_capture_queue throws an exception
then currently the remaining list of targets won't be queued.

https://bugzilla.redhat.com/show_bug.cgi?id=1439888
  • Loading branch information
agrare committed Apr 10, 2017
1 parent 814d462 commit 48c8a95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/models/metric/capture.rb
Expand Up @@ -213,9 +213,13 @@ def self.queue_captures(targets, target_options)

options = target_options[target]

target.perf_capture_queue(interval_name, options)
if !target.kind_of?(Storage) && use_historical && target.last_perf_capture_on.nil?
target.perf_capture_queue('historical')
begin
target.perf_capture_queue(interval_name, options)
if !target.kind_of?(Storage) && use_historical && target.last_perf_capture_on.nil?
target.perf_capture_queue('historical')
end
rescue => err
_log.warn("Failed to queue perf_capture for target [#{target.class.name}], [#{target.id}], [#{target.name}]: #{err}")
end
end
end
Expand Down

0 comments on commit 48c8a95

Please sign in to comment.