feature/next #1

Merged
mathias merged 2 commits from feature/next into master 2024-11-11 11:26:31 -05:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 247b0d356f - Show all commits

View File

@ -12,6 +12,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.3.110.10" />
<PackageReference Include="AWSSDK.S3" Version="3.7.405.11" />
</ItemGroup>
</Project>

View File

@ -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,