aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert_changed.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-11-29 10:18:57 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-11-29 10:18:57 +0000
commitb5d3d793deedd60ebd5dda9056d012ae3a9411a8 (patch)
tree7863c34f6dda4de768cb718d8cb31ec25f53f5a7 /lib/mauve/alert_changed.rb
parent63ebee3b7ce56b49f6c545a4bc095c2f7499b7b8 (diff)
Added alert suppression to the server code + protobuf.
Diffstat (limited to 'lib/mauve/alert_changed.rb')
-rw-r--r--lib/mauve/alert_changed.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/mauve/alert_changed.rb b/lib/mauve/alert_changed.rb
index 6f1a717..64aee7b 100644
--- a/lib/mauve/alert_changed.rb
+++ b/lib/mauve/alert_changed.rb
@@ -99,9 +99,19 @@ module Mauve
end
#
- # Push this notifitcation onto the queue.
+ # Bail out if notifications for this alert have been suppressed.
#
- Server.notification_push([alert, Time.now])
+ if alert.suppressed?
+ #
+ # Skip reminders if the alert is suppressed.
+ #
+ logger.info("Notifications suppressed until #{alert.suppressed_until} for #{alert.inspect}")
+ else
+ #
+ # Push this notifitcation onto the queue.
+ #
+ Server.notification_push([alert, Time.now])
+ end
#
# Need to make sure this reminder is cleared.