lib/flapjack/cli/notifier.rb in flapjack-0.4.11 vs lib/flapjack/cli/notifier.rb in flapjack-0.4.12
- old
+ new
@@ -222,16 +222,17 @@
@log.info("Processing result for check '#{result.id}'")
if result.warning? || result.critical?
if any_parents_warning_or_critical?(result)
@log.info("Not notifying on check '#{result.id}' as parent is failing.")
else
+ @log.info("Creating event for check '#{result.id}'")
+ # FIXME: this will be a performance hit
+ event = ::Event.new(:check_id => result.id)
+ raise unless event.save
+
@log.info("Notifying on check '#{result.id}'")
- @notifier.notify!(result)
+ @notifier.notify!(result, event)
end
-
- @log.info("Creating event for check '#{result.id}'")
- event = Event.new(:check_id => result.id)
- raise unless event.save
end
@log.info("Storing status of check in database")
save_result(result)