Skip to content

Commit

Permalink
docs: update comments about Uptime Kuma (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia authored Oct 24, 2023
1 parent a9bce5c commit 4ecf073
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/monitor/uptimekuma.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ func (h *UptimeKuma) Start(ctx context.Context, ppfmt pp.PP, _message string) bo
// Failure pings the server with status=down.
func (h *UptimeKuma) Failure(ctx context.Context, ppfmt pp.PP, message string) bool {
if len(message) == 0 {
// Uptime Kuma seems to keep the previous message (even if it was for success) by default.
// We thus send an explicit message to overwrite it.
// If we do not send a non-empty message to Uptime Kuma, it seems to
// either keep the previous message (even if it was for success) or
// assume the message is "OK". Either is bad.
//
// We can send a non-empty message to overwrite it.
message = "Failing"
}
return h.ping(ctx, ppfmt, UptimeKumaRequest{Status: "down", Msg: message, Ping: ""})
Expand Down

0 comments on commit 4ecf073

Please sign in to comment.