pull/233/merge
Jake Vis 2026-11-19 10:32:29 -08:00 committed by GitHub
commit aee31edd73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 4 deletions

View File

@ -119,6 +119,13 @@ const Worker = {
}
const currentIncident = state.getIncident(monitor.id, state.incidentLen(monitor.id) - 1)
const downFor = currentTimeSecond - currentIncident.start[0]
const gracePeriod = workerConfig.notification?.gracePeriod
// The first DOWN notification of an incident is sent immediately, or when the grace period is met
const isFirstNotification =
gracePeriod === undefined
? downFor === 0
: downFor >= gracePeriod * 60 - 30 && downFor < gracePeriod * 60 + 30
try {
if (
// monitor status changed AND...
@ -136,10 +143,7 @@ const Worker = {
currentTimeSecond - currentIncident.start[0] <
workerConfig.notification.gracePeriod * 60 + 30)
) {
if (
currentIncident.start[0] !== currentTimeSecond &&
workerConfig.notification?.skipErrorChangeNotification
) {
if (!isFirstNotification && workerConfig.notification?.skipErrorChangeNotification) {
console.log(
'Skipping notification for following error reason change due to user config'
)