Skip to content

Commit

Permalink
add lock/unlock for autodiscovery provider
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Chiang <[email protected]>
  • Loading branch information
roystchiang committed Aug 3, 2021
1 parent 22ed612 commit 6c852d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/discovery/memcache/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ func (p *Provider) Resolve(ctx context.Context, addresses []string) error {

// Addresses returns the latest addresses present in the Provider.
func (p *Provider) Addresses() []string {
p.RLock()
defer p.RUnlock()

var result []string
for _, config := range p.clusterConfigs {
for _, node := range config.nodes {
Expand Down

0 comments on commit 6c852d0

Please sign in to comment.