Skip to content

Commit f270eac

Browse files
committed
Fix notification spam
1 parent 6bc72bc commit f270eac

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/missing-pulse-detector.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ export class MissingPulseDetector {
153153
inGracePeriod: this.isInGracePeriod(),
154154
});
155155

156+
// Don't mark monitors as down during grace period
157+
if (this.isInGracePeriod()) {
158+
Logger.info("Skipping status change during grace period", {
159+
monitorId: monitor.id,
160+
monitorName: monitor.name,
161+
});
162+
return;
163+
}
164+
156165
// Only mark as down after maxRetries consecutive misses
157166
if (missedCount >= monitor.maxRetries) {
158167
const currentStatus = cache.getStatus(monitor.id);
@@ -174,7 +183,7 @@ export class MissingPulseDetector {
174183
});
175184

176185
// Check if we should send notification
177-
if (!this.isInGracePeriod() && this.shouldSendNotification(monitor)) {
186+
if (this.shouldSendNotification(monitor)) {
178187
this.notifyMonitorDown(monitor, timeSinceLastCheck);
179188
}
180189
} else {
@@ -183,7 +192,7 @@ export class MissingPulseDetector {
183192
this.consecutiveDownCounts.set(monitor.id, currentDownCount);
184193

185194
// Check if we should resend notification
186-
if (!this.isInGracePeriod() && this.shouldSendNotification(monitor)) {
195+
if (this.shouldSendNotification(monitor)) {
187196
this.notifyMonitorStillDown(monitor, currentDownCount);
188197
}
189198
}

0 commit comments

Comments
 (0)