mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
[FIX] Lock and lock the map
This commit is contained in:
parent
8d85d6d6fe
commit
b1e204f6d4
@ -256,7 +256,9 @@ func (p *probeManager) WatchServiceHealthy(serviceName string) Watcher {
|
||||
serviceName: serviceName,
|
||||
}
|
||||
if s, ok := p.watches[serviceName]; ok {
|
||||
p.lock.Lock()
|
||||
s[w.id] = w
|
||||
p.lock.Unlock()
|
||||
} else {
|
||||
p.lock.Lock()
|
||||
p.watches[serviceName] = map[string]*watcher{
|
||||
|
Loading…
Reference in New Issue
Block a user