Skip to content

Commit

Permalink
🐛 fixing bug (#1023)
Browse files Browse the repository at this point in the history
* 🐛 fixing bug

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
thibaultleouay and autofix-ci[bot] authored Oct 1, 2024
1 parent e715415 commit 16f2459
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions apps/checker/handlers/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
4 changes: 3 additions & 1 deletion apps/server/src/checker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 16f2459

Please sign in to comment.