Skip to content

Commit

Permalink
Fixed a bug with file storage returning incorrect counts for deleted …
Browse files Browse the repository at this point in the history
…files.
  • Loading branch information
niemyjski committed Sep 27, 2024
1 parent c49dfea commit 00b47d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Foundatio.Minio/Storage/MinioFileStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ public async Task<int> DeleteFilesAsync(string searchPattern = null, Cancellatio
var args = new RemoveObjectsArgs().WithBucket(_bucket)
.WithObjects(result.Files.Select(spec => NormalizePath(spec.Path)).ToList());

var s = await _client.RemoveObjectsAsync(args, cancellation).AnyContext();
count += s.Count;
foreach (var error in s)
var response = await _client.RemoveObjectsAsync(args, cancellation).AnyContext();
count += result.Files.Count;
foreach (var error in response)
{
count--;
_logger.LogError("Error deleting {Path}: {Message}", error.Key, error.Message);
Expand Down

0 comments on commit 00b47d4

Please sign in to comment.