lib/flapjack/data/notification.rb in flapjack-1.0.0rc2 vs lib/flapjack/data/notification.rb in flapjack-1.0.0rc3

- old
+ new

@@ -222,18 +222,20 @@ # 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) + case when rollup_threshold.nil? # 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 (alerting_checks + cleaned) >= rollup_threshold # 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}" end