From 00b47d45dbc1ed55cb7b989376a21738f7e64361 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Thu, 26 Sep 2024 21:41:41 -0500 Subject: [PATCH] Fixed a bug with file storage returning incorrect counts for deleted files. --- src/Foundatio.Minio/Storage/MinioFileStorage.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Foundatio.Minio/Storage/MinioFileStorage.cs b/src/Foundatio.Minio/Storage/MinioFileStorage.cs index 08fbd10..8aa774c 100644 --- a/src/Foundatio.Minio/Storage/MinioFileStorage.cs +++ b/src/Foundatio.Minio/Storage/MinioFileStorage.cs @@ -271,9 +271,9 @@ public async Task 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);