mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
reload bucket metadata outside the locker (#9659)
This commit is contained in:
parent
2164984d2b
commit
baa30f4289
@ -258,9 +258,9 @@ func (sys *BucketMetadataSys) GetConfig(bucket string) (BucketMetadata, error) {
|
|||||||
return newBucketMetadata(bucket), errInvalidArgument
|
return newBucketMetadata(bucket), errInvalidArgument
|
||||||
}
|
}
|
||||||
|
|
||||||
sys.Lock()
|
sys.RLock()
|
||||||
defer sys.Unlock()
|
|
||||||
meta, ok := sys.metadataMap[bucket]
|
meta, ok := sys.metadataMap[bucket]
|
||||||
|
sys.RUnlock()
|
||||||
if ok {
|
if ok {
|
||||||
return meta, nil
|
return meta, nil
|
||||||
}
|
}
|
||||||
@ -268,7 +268,9 @@ func (sys *BucketMetadataSys) GetConfig(bucket string) (BucketMetadata, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return meta, err
|
return meta, err
|
||||||
}
|
}
|
||||||
|
sys.Lock()
|
||||||
sys.metadataMap[bucket] = meta
|
sys.metadataMap[bucket] = meta
|
||||||
|
sys.Unlock()
|
||||||
return meta, nil
|
return meta, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user