Skip to content

Commit

Permalink
Merge pull request #206 from xuzhu-591/fix-informer-mutex
Browse files Browse the repository at this point in the history
fix: optimize informer locking logic
  • Loading branch information
xuzhu-591 authored Dec 7, 2023
2 parents 2381d6d + 9918349 commit ed83f01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/regioninformers/regioninformers.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ func (f *RegionInformers) NewRegionInformers(region *models.Region) error {
lastUpdated: region.UpdatedAt,
}

f.registerHandler(&client)

f.mu.Lock()
defer f.mu.Unlock()
f.clients[region.ID] = &client

f.registerHandler(&client)
return nil
}

Expand Down

0 comments on commit ed83f01

Please sign in to comment.