Skip to content

Commit 709f306

Browse files
Only process jobs for incidents which happened in the last hour
1 parent d5e5670 commit 709f306

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jobrunner/internal/incidentpoller/incidentpoller.go

+7
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ func (p *IncidentPoller) pollInner() error {
6868
if p.slackWebhookUrl == "" {
6969
continue
7070
}
71+
72+
// We only want to notify about incidents that have started in the last hour
73+
// Otherwise, we will be sending notifications for incidents that have already been resolved
74+
if incident.StartTime.Before(time.Now().Add(-1 * time.Hour)) {
75+
continue
76+
}
77+
7178
if incident.Impact == "maintenance" {
7279
continue
7380
}

0 commit comments

Comments
 (0)