Class: Katello::EventDaemon::Services::AgentEventReceiver::Handler
- Inherits:
-
Object
- Object
- Katello::EventDaemon::Services::AgentEventReceiver::Handler
- Defined in:
- app/lib/katello/event_daemon/services/agent_event_receiver.rb
Instance Attribute Summary collapse
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#processed ⇒ Object
Returns the value of attribute processed.
Instance Method Summary collapse
- #handle(message) ⇒ Object
-
#initialize ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize ⇒ Handler
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
#failed ⇒ Object
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 |
#processed ⇒ Object
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() ::Katello::Util::Support.with_db_connection do ::Katello::Agent::ClientMessageHandler.new().handle @processed += 1 rescue => e @failed += 1 Rails.logger.error("Error handling Katello Agent client message") Rails.logger.error(e.) Rails.logger.error(e.backtrace.join("\n")) end end |