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
+3 -3
View File
@@ -84,7 +84,7 @@ func TestShouldSendAlertNotification(t *testing.T) {
prevState: m.AlertStateAlerting,
frequency: time.Minute * 10,
sendReminder: true,
state: &m.AlertNotificationState{SentAt: tnow.Add(-time.Minute).Unix()},
state: &m.AlertNotificationState{UpdatedAt: tnow.Add(-time.Minute).Unix()},
expect: true,
},
@@ -104,7 +104,7 @@ func TestShouldSendAlertNotification(t *testing.T) {
prevState: m.AlertStateAlerting,
frequency: time.Minute * 10,
sendReminder: true,
state: &m.AlertNotificationState{SentAt: tnow.Add(-time.Minute).Unix()},
state: &m.AlertNotificationState{UpdatedAt: tnow.Add(-time.Minute).Unix()},
expect: false,
},
@@ -114,7 +114,7 @@ func TestShouldSendAlertNotification(t *testing.T) {
prevState: m.AlertStateAlerting,
frequency: time.Minute * 10,
sendReminder: true,
state: &m.AlertNotificationState{SentAt: tnow.Add(-11 * time.Minute).Unix()},
state: &m.AlertNotificationState{UpdatedAt: tnow.Add(-11 * time.Minute).Unix()},
expect: true,
},