aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-04 12:37:53 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-04 12:37:53 +0100
commit523acaf4501313b2462bb21f90f248d5d8e4d932 (patch)
tree77c5d972c16835ee2845ad6bb7f9c03fd1194c19 /lib/mauve/alert.rb
parent89ee7e1a43bca0fc382c23176d1c6aed97b2750b (diff)
Fixed up some templates.
Diffstat (limited to 'lib/mauve/alert.rb')
-rw-r--r--lib/mauve/alert.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb
index 6dc3216..7768f50 100644
--- a/lib/mauve/alert.rb
+++ b/lib/mauve/alert.rb
@@ -375,7 +375,12 @@ module Mauve
#
if raise_time
if raise_time <= (reception_time + 5)
- alert_db.raised_at = raise_time
+ #
+ # Don't reset the raised_at time if the alert is already raised.
+ # This prevents the raised time constantly changing on alerts
+ # that are already raised.
+ #
+ alert_db.raised_at = raise_time unless was_raised or alert_db.raised_at.nil?
alert_db.will_raise_at = nil
else
alert_db.raised_at = nil
@@ -385,7 +390,10 @@ module Mauve
if clear_time
if clear_time <= (reception_time + 5)
- alert_db.cleared_at = clear_time
+ #
+ # Don't reset the cleared_at time (see above for raised_at timings).
+ #
+ alert_db.cleared_at = clear_time unless was_cleared or alert_db.cleared_at.nil?
alert_db.will_clear_at = nil
else
alert_db.cleared_at = nil