mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
fix: [2.4] Re-read value after once
initialization (#35643)
Cherry-pick from master pr: #35642 Related to #35641 See also #35271 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
e014ad9280
commit
9c67965d6c
@ -41,12 +41,14 @@ func getPriCache() *PrivilegeCache {
|
|||||||
priCacheInitOnce.Do(func() {
|
priCacheInitOnce.Do(func() {
|
||||||
priCacheMut.Lock()
|
priCacheMut.Lock()
|
||||||
defer priCacheMut.Unlock()
|
defer priCacheMut.Unlock()
|
||||||
c = &PrivilegeCache{
|
priCache = &PrivilegeCache{
|
||||||
version: ver.Inc(),
|
version: ver.Inc(),
|
||||||
values: typeutil.ConcurrentMap[string, bool]{},
|
values: typeutil.ConcurrentMap[string, bool]{},
|
||||||
}
|
}
|
||||||
priCache = c
|
|
||||||
})
|
})
|
||||||
|
priCacheMut.RLock()
|
||||||
|
defer priCacheMut.RUnlock()
|
||||||
|
c = priCache
|
||||||
}
|
}
|
||||||
|
|
||||||
return c
|
return c
|
||||||
|
Loading…
Reference in New Issue
Block a user