aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert_changed.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/alert_changed.rb')
-rw-r--r--lib/mauve/alert_changed.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/mauve/alert_changed.rb b/lib/mauve/alert_changed.rb
index 9b74396..2871aee 100644
--- a/lib/mauve/alert_changed.rb
+++ b/lib/mauve/alert_changed.rb
@@ -61,11 +61,22 @@ module Mauve
if alert.acknowledged?
- logger.info("Alert already acknowledged. Clearing reminder due for #{self.alert}.")
+ logger.info("Alert already acknowledged. Clearing reminder due for #{self.alert}.")
self.remind_at = nil
return save
end
+ #
+ # Postpone reminders from previous runs, if needed.
+ #
+ if Server.instance.in_initial_sleep? and
+ self.at < Server.instance.started_at
+
+ self.remind_at = Server.instance.started_at + Server.instance.initial_sleep
+ logger.info("Postponing reminder for #{self.alert} until #{self.remind_at} since this reminder was updated in a prior run of Mauve.")
+ return save
+ end
+
alert_group.notify(alert)
#
# Need to make sure this reminder is cleared.