Class: Katello::EventDaemon::Services::AgentEventReceiver::Handler

Inherits:
Object
  • Object
show all
Defined in:
app/lib/katello/event_daemon/services/agent_event_receiver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHandler

Returns a new instance of Handler.



8
9
10
11
# File 'app/lib/katello/event_daemon/services/agent_event_receiver.rb', line 8

def initialize
  @processed = 0
  @failed = 0
end

Instance Attribute Details

#failedObject

Returns the value of attribute failed.



6
7
8
# File 'app/lib/katello/event_daemon/services/agent_event_receiver.rb', line 6

def failed
  @failed
end

#processedObject

Returns the value of attribute processed.



6
7
8
# File 'app/lib/katello/event_daemon/services/agent_event_receiver.rb', line 6

def processed
  @processed
end

Instance Method Details

#handle(message) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'app/lib/katello/event_daemon/services/agent_event_receiver.rb', line 13

def handle(message)
  ::Katello::Util::Support.with_db_connection do
    ::Katello::Agent::ClientMessageHandler.new(message).handle
    @processed += 1
  rescue => e
    @failed += 1
    Rails.logger.error("Error handling Katello Agent client message")
    Rails.logger.error(e.message)
    Rails.logger.error(e.backtrace.join("\n"))
  end
end