Sha256: ca3fc86b253b86cdac4a722f70f1cb22a1b86166fce047bc3303b8f92728a9c2

Contents?: true

Size: 696 Bytes

Versions: 4

Compression:

Stored size: 696 Bytes

Contents

module Rearview
  class AlertsHandler
    include Rearview::Logger
    attr_reader :job,:monitor_result
    def initialize(job,monitor_results)
      @job = job
      @monitor_results = monitor_results
    end
    def run
      logger.info "#{self} run"
      if Rearview.config.alerts_enabled?
        Rearview.alert_clients.each do |client|
          alert_agent = client.new
          begin
            alert_agent.alert(@job,@monitor_results)
          rescue
            logger.error "#{self} #{alert_agent} failed: #{$!}\n#{$@.join("\n")}"
          end
        end
      end
      self
    rescue
      logger.error "#{self} failed: #{$!}\n#{$@.join("\n")}"
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rearview-1.1.2-jruby lib/rearview/alerts_handler.rb
rearview-1.1.1-jruby lib/rearview/alerts_handler.rb
rearview-1.1.0-jruby lib/rearview/alerts_handler.rb
rearview-1.0.3.rc.4-jruby lib/rearview/alerts_handler.rb