mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-29 13:51:51 +02:00
fix countHealthy locking
This commit is contained in:
1 parent
98042d8dbd
commit
d37d0e942c
1 file changed
+2
-2
@@ -150,11 +150,11 @@ func (p *prog) checkUpstream(upstream string, uc *ctrld.UpstreamConfig) {
|
|||||||
func (um *upstreamMonitor) countHealthy(upstreams []string) int {
|
func (um *upstreamMonitor) countHealthy(upstreams []string) int {
|
||||||
var count int
|
var count int
|
||||||
um.mu.RLock()
|
um.mu.RLock()
|
||||||
defer um.mu.RUnlock()
|
|
||||||
for _, upstream := range upstreams {
|
for _, upstream := range upstreams {
|
||||||
if !um.isDown(upstream) {
|
if !um.down[upstream] {
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
um.mu.RUnlock()
|
||||||
return count
|
return count
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user