From 247b0d356f0130a6adc1bef41552faf8cb92ec71 Mon Sep 17 00:00:00 2001 From: Mathias Beaulieu-Duncan Date: Sun, 10 Nov 2024 23:48:12 -0500 Subject: [PATCH] update aws s3 dependency --- OpenHarbor.Storage.S3/OpenHarbor.Storage.S3.csproj | 2 +- OpenHarbor.Storage.S3/S3StorageProvider.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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,