mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
Enhancements to daily-sweeper routine to reduce CPU load (#8209)
- ListObjectsHeal should list only objects which need healing, not the entire namespace. - DeleteObjects() to be used to delete 1000s of objects in bulk instead of serially.
This commit is contained in:
committed by
kannappanr
parent
432cb38dbd
commit
e12f52e2c6
@@ -139,22 +139,24 @@ func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
var objects []string
|
||||
for _, obj := range res.Objects {
|
||||
// Find the action that need to be executed
|
||||
action := l.ComputeAction(obj.Name, obj.ModTime)
|
||||
switch action {
|
||||
case lifecycle.DeleteAction:
|
||||
objAPI.DeleteObject(ctx, bucket.Name, obj.Name)
|
||||
objects = append(objects, obj.Name)
|
||||
default:
|
||||
// Nothing
|
||||
|
||||
// Do nothing, for now.
|
||||
}
|
||||
}
|
||||
// Deletes a list of objects.
|
||||
objAPI.DeleteObjects(ctx, bucket.Name, objects)
|
||||
if !res.IsTruncated {
|
||||
// We are done here, proceed to next bucket.
|
||||
break
|
||||
} else {
|
||||
marker = res.NextMarker
|
||||
}
|
||||
marker = res.NextMarker
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user