diff --git a/OpenHarbor.Storage.S3/OpenHarbor.Storage.S3.csproj b/OpenHarbor.Storage.S3/OpenHarbor.Storage.S3.csproj index a421868..b876719 100644 --- a/OpenHarbor.Storage.S3/OpenHarbor.Storage.S3.csproj +++ b/OpenHarbor.Storage.S3/OpenHarbor.Storage.S3.csproj @@ -12,6 +12,6 @@ - + diff --git a/OpenHarbor.Storage.S3/S3StorageProvider.cs b/OpenHarbor.Storage.S3/S3StorageProvider.cs index 376fdb2..5508309 100644 --- a/OpenHarbor.Storage.S3/S3StorageProvider.cs +++ b/OpenHarbor.Storage.S3/S3StorageProvider.cs @@ -51,13 +51,15 @@ public partial class S3StorageProvider(string endpoint, string bucketName, strin public async Task DeleteDirectoryAsync(string path, bool force = false, CancellationToken cancellationToken = default) { using var client = GetClient(); - var files = await this.GetS3FilesAsync(prefix: path, delimiter: null, cancellationToken: cancellationToken); + var files = await GetS3FilesAsync(prefix: path, delimiter: null, cancellationToken: cancellationToken); var next = files.AsQueryable(); while(next.Any()) { var next1000 = next.Take(1000); - var keys = next1000.Select(s3o => new KeyVersion { Key = s3o.Key }).ToList(); + var keys = next1000.Select(s3Object => new KeyVersion { Key = s3Object.Key }) + .ToList(); + await client.DeleteObjectsAsync(new DeleteObjectsRequest { BucketName = bucketName,