diff --git a/apps/checker/handlers/checker.go b/apps/checker/handlers/checker.go index a2f6e1576c..1bf9723816 100644 --- a/apps/checker/handlers/checker.go +++ b/apps/checker/handlers/checker.go @@ -222,6 +222,17 @@ func (h Handler) HTTPCheckerHandler(c *gin.Context) { CronTimestamp: req.CronTimestamp, }) } + + // This happens when we don't have a degradedAfter + if isSuccessfull && req.DegradedAfter == 0 { + checker.UpdateStatus(ctx, checker.UpdateData{ + MonitorId: req.MonitorID, + Status: "active", + Region: h.Region, + StatusCode: res.Status, + CronTimestamp: req.CronTimestamp, + }) + } } if req.Status == "degraded" { diff --git a/apps/server/src/checker/index.ts b/apps/server/src/checker/index.ts index de13d2f79d..3050d933c8 100644 --- a/apps/server/src/checker/index.ts +++ b/apps/server/src/checker/index.ts @@ -179,7 +179,9 @@ checkerRoute.post("/updateStatus", async (c) => { message, notifType: "alert", cronTimestamp, - incidentId: String(newIncident[0].id), + incidentId: newIncident.length + ? String(newIncident[0]?.id) + : `${cronTimestamp}`, }); if (newIncident.length > 0) {