reminder: uses UpdatedAt to track state changes.

This commit is contained in:
bergquist
2018-10-02 11:19:09 +02:00
parent 9e09b2b969
commit 7f1d7cefc0
7 changed files with 21 additions and 25 deletions
+2 -2
View File
@@ -53,8 +53,8 @@ func defaultShouldNotify(context *alerting.EvalContext, sendReminder bool, frequ
if context.PrevAlertState == context.Rule.State && sendReminder {
// Do not notify if interval has not elapsed
lastNotify := time.Unix(notificationState.SentAt, 0)
if notificationState.SentAt != 0 && lastNotify.Add(frequency).After(time.Now()) {
lastNotify := time.Unix(notificationState.UpdatedAt, 0)
if notificationState.UpdatedAt != 0 && lastNotify.Add(frequency).After(time.Now()) {
return false
}