mirror of https://github.com/milvus-io/milvus.git
fix: Re-read value after `once` initialization (#35642)
Related to #35641 See also #35271 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/35656/head
parent
582d2eec79
commit
9fff07936a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue