From f1d3e08e1d505d76b7441ff32929f4f77b8355a9 Mon Sep 17 00:00:00 2001 From: Sotirios Diamantis Date: Fri, 13 May 2022 12:11:49 -0700 Subject: [PATCH 1/2] Update FileTarget.cs --- MetroLog.Shared.WinRT/FileTarget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MetroLog.Shared.WinRT/FileTarget.cs b/MetroLog.Shared.WinRT/FileTarget.cs index 7d31406..45d7042 100644 --- a/MetroLog.Shared.WinRT/FileTarget.cs +++ b/MetroLog.Shared.WinRT/FileTarget.cs @@ -56,7 +56,7 @@ protected override Task EnsureInitialized() protected sealed override async Task DoCleanup(Regex pattern, DateTime threshold) { - var toDelete = (await logFolder.GetFilesAsync()) + var toDelete = (await logFolder.GetFilesAsync().AsTask().ConfigureAwait(false)) .Where(file => pattern.Match(file.Name).Success && file.DateCreated <= threshold) .ToList(); From 5fbf3e2b39acbffe96c95b4cae1c3594cadb0e03 Mon Sep 17 00:00:00 2001 From: Sotirios Diamantis Date: Fri, 13 May 2022 12:13:48 -0700 Subject: [PATCH 2/2] Update FileTargetBase.cs --- MetroLog.Shared/Targets/FileTargetBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MetroLog.Shared/Targets/FileTargetBase.cs b/MetroLog.Shared/Targets/FileTargetBase.cs index 1cd375b..37f4ce6 100644 --- a/MetroLog.Shared/Targets/FileTargetBase.cs +++ b/MetroLog.Shared/Targets/FileTargetBase.cs @@ -90,7 +90,7 @@ async Task CheckCleanupAsync() // walk... var regex = FileNamingParameters.GetRegex(); - await DoCleanup(regex, threshold); + await DoCleanup(regex, threshold).ConfigureAwait(false); } finally {