From 0d8d8a9bfb0efae57aa5b4336ecb4aeeac26d850 Mon Sep 17 00:00:00 2001 From: Sebakov Dmitriy Sergeevich Date: Mon, 29 Nov 2021 12:54:18 +0300 Subject: [PATCH] Fix TryRunJob --- src/Horarium/Handlers/RunnerJobs.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Horarium/Handlers/RunnerJobs.cs b/src/Horarium/Handlers/RunnerJobs.cs index 731b8da..ebe6857 100644 --- a/src/Horarium/Handlers/RunnerJobs.cs +++ b/src/Horarium/Handlers/RunnerJobs.cs @@ -137,15 +137,15 @@ private async Task TryRunJob(CancellationToken cancellationToken, TimeSpan throw new TaskCanceledException(); } - if (isJobReady) - { - return true; - } - if (!waitTime.Equals(TimeSpan.Zero)) { await Task.Delay(waitTime, cancellationToken); } + + if (isJobReady) + { + return true; + } } return false;