Skip to content

Commit

Permalink
fix: [2.4] Re-read value after once initialization (#35643)
Browse files Browse the repository at this point in the history
Cherry-pick from master
pr: #35642
Related to #35641
See also #35271

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Aug 22, 2024
1 parent e014ad9 commit 9c67965
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/proxy/privilege_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ func getPriCache() *PrivilegeCache {
priCacheInitOnce.Do(func() {
priCacheMut.Lock()
defer priCacheMut.Unlock()
c = &PrivilegeCache{
priCache = &PrivilegeCache{
version: ver.Inc(),
values: typeutil.ConcurrentMap[string, bool]{},
}
priCache = c
})
priCacheMut.RLock()
defer priCacheMut.RUnlock()
c = priCache
}

return c
Expand Down

0 comments on commit 9c67965

Please sign in to comment.