From 6583c9aff390bb9f5527e427de6c9e92f63278b8 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Wed, 4 Dec 2019 17:58:04 +0800 Subject: [PATCH] Fix loops when configuration items are abnormal or unreachable. #444 --- src/DotNetCore.CAP/Processor/IProcessor.InfiniteRetry.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DotNetCore.CAP/Processor/IProcessor.InfiniteRetry.cs b/src/DotNetCore.CAP/Processor/IProcessor.InfiniteRetry.cs index 9aba0e7..bb34dee 100644 --- a/src/DotNetCore.CAP/Processor/IProcessor.InfiniteRetry.cs +++ b/src/DotNetCore.CAP/Processor/IProcessor.InfiniteRetry.cs @@ -30,11 +30,12 @@ namespace DotNetCore.CAP.Processor } catch (OperationCanceledException) { - //ignore + //ignore } catch (Exception ex) { - _logger.LogWarning(1, ex, "Processor '{ProcessorName}' failed. Retrying...", _inner.ToString()); + _logger.LogWarning(ex, "Processor '{ProcessorName}' failed. Retrying...", _inner.ToString()); + await context.WaitAsync(TimeSpan.FromSeconds(2)); } } }