Skip to content

Commit

Permalink
handle the no-checker-functions simple case
Browse files Browse the repository at this point in the history
  • Loading branch information
skandragon committed Jan 25, 2022
1 parent 6295db0 commit f02a22e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ func (h *Health) RunCheckers(frequency int) {
nextIndex = 0
firstPass = false
}
h.Unlock()
h.runChecker(&h.Checks[nextIndex])
h.Lock()
if len(h.Checks) > 0 {
h.Unlock()
h.runChecker(&h.Checks[nextIndex])
h.Lock()
}
nextIndex++

// Now, check all statuses and compute the global status
Expand Down

0 comments on commit f02a22e

Please sign in to comment.