mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-06-21 13:00:05 +02:00
remove leaking logic in favor of recovery logic.
This commit is contained in:
@@ -145,3 +145,16 @@ func (p *prog) checkUpstream(upstream string, uc *ctrld.UpstreamConfig) {
|
||||
time.Sleep(checkUpstreamBackoffSleep)
|
||||
}
|
||||
}
|
||||
|
||||
// countHealthy returns the number of upstreams in the provided map that are considered healthy.
|
||||
func (um *upstreamMonitor) countHealthy(upstreams []string) int {
|
||||
var count int
|
||||
um.mu.RLock()
|
||||
defer um.mu.RUnlock()
|
||||
for _, upstream := range upstreams {
|
||||
if !um.isDown(upstream) {
|
||||
count++
|
||||
}
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user