Skip to content

Commit

Permalink
fix Consul data race (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyt122 authored Sep 4, 2024
1 parent c0c4192 commit 87f0d4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controller/registries/consul/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ func (reg *Consul) refresh(services map[string][]string) {
}
}
}
reg.lock.Lock()
defer reg.lock.Unlock()
prevFetchServices := reg.watchingServices
reg.watchingServices = serviceMap

Expand Down

0 comments on commit 87f0d4f

Please sign in to comment.