mirror of
https://github.com/minio/minio.git
synced 2025-03-31 17:53:43 -04:00
fix: cleanup lifecycle unused code (#9219)
This commit is contained in:
parent
6f992134a2
commit
7f8f1ad4e3
@ -44,22 +44,12 @@ func startDailyLifecycle(ctx context.Context, objAPI ObjectLayer) {
|
|||||||
return
|
return
|
||||||
case <-time.NewTimer(bgLifecycleInterval).C:
|
case <-time.NewTimer(bgLifecycleInterval).C:
|
||||||
// Perform one lifecycle operation
|
// Perform one lifecycle operation
|
||||||
err := lifecycleRound(ctx, objAPI)
|
logger.LogIf(ctx, lifecycleRound(ctx, objAPI))
|
||||||
switch err.(type) {
|
|
||||||
case OperationTimedOut:
|
|
||||||
// Unable to hold a lock means there is another
|
|
||||||
// caller holding write lock, ignore and try next round.
|
|
||||||
continue
|
|
||||||
default:
|
|
||||||
logger.LogIf(ctx, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var lifecycleLockTimeout = newDynamicTimeout(60*time.Second, time.Second)
|
|
||||||
|
|
||||||
func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
|
func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
|
||||||
buckets, err := objAPI.ListBuckets(ctx)
|
buckets, err := objAPI.ListBuckets(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user