From 11f4c006a35f3798180ea146f3b9f4e5d37fa1b5 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 17 Mar 2019 20:00:53 +0100 Subject: [PATCH] Improved lock store. --- src/Squidex.Infrastructure/Log/LockingLogStore.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Squidex.Infrastructure/Log/LockingLogStore.cs b/src/Squidex.Infrastructure/Log/LockingLogStore.cs index bafce0bd2..83829d129 100644 --- a/src/Squidex.Infrastructure/Log/LockingLogStore.cs +++ b/src/Squidex.Infrastructure/Log/LockingLogStore.cs @@ -52,10 +52,17 @@ namespace Squidex.Infrastructure.Log break; } - await Task.Delay(2000, cts.Token); + try + { + await Task.Delay(2000, cts.Token); + } + catch (TaskCanceledException) + { + break; + } } - if (!cts.IsCancellationRequested) + if (releaseToken != null) { try {