fix: cleanup lifecycle unused code (#9219)

This commit is contained in:
Anis Elleuch 2020-03-28 02:57:50 +01:00 committed by GitHub
parent 6f992134a2
commit 7f8f1ad4e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,22 +44,12 @@ func startDailyLifecycle(ctx context.Context, objAPI ObjectLayer) {
return
case <-time.NewTimer(bgLifecycleInterval).C:
// Perform one lifecycle operation
err := 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)
}
logger.LogIf(ctx, lifecycleRound(ctx, objAPI))
}
}
}
var lifecycleLockTimeout = newDynamicTimeout(60*time.Second, time.Second)
func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
buckets, err := objAPI.ListBuckets(ctx)
if err != nil {