mirror of
https://github.com/minio/minio.git
synced 2025-04-12 15:32:07 -04:00
fix: close the channel appropriately for dataUsageEntry (#12432)
Bonus: initialize dataScanner routines after server config has initialized. fixes #12430
This commit is contained in:
parent
3109441258
commit
c0e79e28b2
@ -333,6 +333,8 @@ func (fs *FSObjects) NSScanner(ctx context.Context, bf *bloomFilter, updates cha
|
|||||||
// The updated cache for the bucket is returned.
|
// The updated cache for the bucket is returned.
|
||||||
// A partially updated bucket may be returned.
|
// A partially updated bucket may be returned.
|
||||||
func (fs *FSObjects) scanBucket(ctx context.Context, bucket string, cache dataUsageCache) (dataUsageCache, error) {
|
func (fs *FSObjects) scanBucket(ctx context.Context, bucket string, cache dataUsageCache) (dataUsageCache, error) {
|
||||||
|
defer close(cache.Info.updates)
|
||||||
|
|
||||||
// Get bucket policy
|
// Get bucket policy
|
||||||
// Check if the current bucket has a configured lifecycle policy
|
// Check if the current bucket has a configured lifecycle policy
|
||||||
lc, err := globalLifecycleSys.Get(bucket)
|
lc, err := globalLifecycleSys.Get(bucket)
|
||||||
|
@ -531,7 +531,6 @@ func serverMain(ctx *cli.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initBackgroundExpiry(GlobalContext, newObject)
|
initBackgroundExpiry(GlobalContext, newObject)
|
||||||
initDataScanner(GlobalContext, newObject)
|
|
||||||
|
|
||||||
if err = initServer(GlobalContext, newObject); err != nil {
|
if err = initServer(GlobalContext, newObject); err != nil {
|
||||||
var cerr config.Err
|
var cerr config.Err
|
||||||
@ -549,6 +548,8 @@ func serverMain(ctx *cli.Context) {
|
|||||||
logger.LogIf(GlobalContext, err)
|
logger.LogIf(GlobalContext, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initDataScanner(GlobalContext, newObject)
|
||||||
|
|
||||||
if globalIsErasure { // to be done after config init
|
if globalIsErasure { // to be done after config init
|
||||||
initBackgroundReplication(GlobalContext, newObject)
|
initBackgroundReplication(GlobalContext, newObject)
|
||||||
globalTierJournal, err = initTierDeletionJournal(GlobalContext.Done())
|
globalTierJournal, err = initTierDeletionJournal(GlobalContext.Done())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user