lib/flapjack/data/notification.rb in flapjack-1.5.0 vs lib/flapjack/data/notification.rb in flapjack-1.6.0rc1

- old
+ new

@@ -219,12 +219,12 @@ rollup_type = nil contact.add_alerting_check_for_media(media, @event_id) unless ok? || acknowledgement? || test? # expunge checks in (un)scheduled maintenance from the alerting set - cleaned = contact.clean_alerting_checks_for_media(media) - logger.debug("cleaned alerting checks for #{media}: #{cleaned}") + recovered = contact.clean_alerting_checks_for_media(media) + logger.debug("cleaned alerting checks for #{media}: recovered? #{recovered}") # pagerduty is an example of a medium which should never be rolled up unless ['pagerduty'].include?(media) alerting_checks = contact.count_alerting_checks_for_media(media) rollup_threshold = contact.rollup_threshold_for_media(media) @@ -234,10 +234,10 @@ # back away slowly when alerting_checks >= rollup_threshold next ret if contact.drop_rollup_notifications_for_media?(media) contact.update_sent_rollup_alert_keys_for_media(media, :delete => ok?) rollup_type = 'problem' - when (alerting_checks + cleaned) >= rollup_threshold + when recovered # alerting checks was just cleaned such that it is now below the rollup threshold contact.update_sent_rollup_alert_keys_for_media(media, :delete => true) rollup_type = 'recovery' end logger.debug "rollup decisions: #{@event_id} #{@state} #{media} #{address} rollup_type: #{rollup_type}"