Skip to content

Commit

Permalink
Only process jobs for incidents which happened in the last hour
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisbattarbee committed Apr 4, 2024
1 parent d5e5670 commit 709f306
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jobrunner/internal/incidentpoller/incidentpoller.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ func (p *IncidentPoller) pollInner() error {
if p.slackWebhookUrl == "" {
continue
}

// We only want to notify about incidents that have started in the last hour
// Otherwise, we will be sending notifications for incidents that have already been resolved
if incident.StartTime.Before(time.Now().Add(-1 * time.Hour)) {
continue
}

if incident.Impact == "maintenance" {
continue
}
Expand Down

0 comments on commit 709f306

Please sign in to comment.