aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-11-23 15:39:22 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-11-23 15:39:22 +0000
commit9b69cf2c36140bc9de9976286e46866211bb17a3 (patch)
treec2a13d17aae2c2419af1eb782935913f60aeef93
parent4e93857386ca1c4d6ad744195a672c25f2fb45ae (diff)
Missed the fact that the alert group was being looked up earlier in Notifier#notify.
-rw-r--r--lib/mauve/notifier.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/mauve/notifier.rb b/lib/mauve/notifier.rb
index d433e96..35ac019 100644
--- a/lib/mauve/notifier.rb
+++ b/lib/mauve/notifier.rb
@@ -41,17 +41,24 @@ module Mauve
#
alert.reload
- if alert.alert_group.nil?
+ #
+ # Forces alert-group to be re-evaluated on notification.
+ #
+ alert.cached_alert_group = nil
+ this_alert_group = alert.alert_group
+
+ #
+ # This saves without callbacks if the cached_alert_group has been
+ # altered.
+ #
+ alert.save! if alert.dirty?
+
+ if this_alert_group.nil?
logger.warn "Could not notify for #{alert} since there are no matching alert groups"
else
- # Forces alert-group to be re-evaluated on notification.
- alert.cached_alert_group = nil
- alert.alert_group.notify(alert, at)
- #
- # This saves without callbacks if the alert has been altered.
- #
- alert.save! if alert.dirty?
+ this_alert_group.notify(alert, at)
+
end
end