mirror of
https://github.com/minio/minio.git
synced 2025-11-13 15:21:36 -05:00
fix: prioritized latest buckets for crawler to finish the scans faster (#11115)
crawler should only ListBuckets once not for each serverPool, buckets are same across all pools, across sets and ListBuckets always returns an unified view, once list buckets returns sort it by create time to scan the latest buckets earlier with the assumption that latest buckets would have lesser content than older buckets allowing them to be scanned faster and also to be able to provide more closer to latest view.
This commit is contained in:
@@ -531,7 +531,9 @@ func (fs *FSObjects) ListBuckets(ctx context.Context) ([]BucketInfo, error) {
|
||||
}
|
||||
|
||||
// Sort bucket infos by bucket name.
|
||||
sort.Sort(byBucketName(bucketInfos))
|
||||
sort.Slice(bucketInfos, func(i, j int) bool {
|
||||
return bucketInfos[i].Name < bucketInfos[j].Name
|
||||
})
|
||||
|
||||
// Succes.
|
||||
return bucketInfos, nil
|
||||
|
||||
Reference in New Issue
Block a user