Skip to content

Commit 3ac200d

Browse files
committed
Modify ClearIssuesForCheck function to only log if there was actually an issue to clear
1 parent 51286f5 commit 3ac200d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

comp/healthplatform/impl/health-platform.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,14 @@ func (h *healthPlatformImpl) ClearIssuesForCheck(checkID string) {
223223
h.issuesMux.Lock()
224224
defer h.issuesMux.Unlock()
225225

226-
delete(h.issues, checkID)
227-
h.log.Info("Cleared issue for check: " + checkID)
226+
// Only log if there was actually an issue to clear
227+
if _, existed := h.issues[checkID]; existed {
228+
delete(h.issues, checkID)
229+
h.log.Info("Cleared issue for check: " + checkID)
230+
} else {
231+
// No issue existed, just ensure it's not in the map (idempotent)
232+
delete(h.issues, checkID)
233+
}
228234
}
229235

230236
// ClearAllIssues clears all issues (useful for testing or when all issues are resolved)

0 commit comments

Comments
 (0)