|
|
@ -710,16 +710,15 @@ func (l *s3EncObjects) cleanupStaleEncMultipartUploads(ctx context.Context, clea |
|
|
|
|
|
|
|
|
|
|
|
// cleanupStaleUploads removes old custom encryption multipart uploads on backend
|
|
|
|
// cleanupStaleUploads removes old custom encryption multipart uploads on backend
|
|
|
|
func (l *s3EncObjects) cleanupStaleUploads(ctx context.Context, expiry time.Duration) { |
|
|
|
func (l *s3EncObjects) cleanupStaleUploads(ctx context.Context, expiry time.Duration) { |
|
|
|
for { |
|
|
|
buckets, err := l.s3Objects.ListBuckets(ctx) |
|
|
|
buckets, err := l.s3Objects.ListBuckets(ctx) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
logger.LogIf(ctx, err) |
|
|
|
break |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
for _, b := range buckets { |
|
|
|
for _, b := range buckets { |
|
|
|
expParts := l.getStalePartsForBucket(ctx, b.Name, expiry) |
|
|
|
expParts := l.getStalePartsForBucket(ctx, b.Name, expiry) |
|
|
|
for k := range expParts { |
|
|
|
for k := range expParts { |
|
|
|
l.s3Objects.DeleteObject(ctx, b.Name, k, minio.ObjectOptions{}) |
|
|
|
l.s3Objects.DeleteObject(ctx, b.Name, k, minio.ObjectOptions{}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -731,6 +730,7 @@ func (l *s3EncObjects) getStalePartsForBucket(ctx context.Context, bucket string |
|
|
|
for { |
|
|
|
for { |
|
|
|
loi, err := l.s3Objects.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, 1000, false, startAfter) |
|
|
|
loi, err := l.s3Objects.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, 1000, false, startAfter) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
logger.LogIf(ctx, err) |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
for _, obj := range loi.Objects { |
|
|
|
for _, obj := range loi.Objects { |
|
|
|