diff --git a/src/RawRabbit/Operations/Requester.cs b/src/RawRabbit/Operations/Requester.cs index 19b8dfa6..e41ccb1e 100644 --- a/src/RawRabbit/Operations/Requester.cs +++ b/src/RawRabbit/Operations/Requester.cs @@ -27,6 +27,7 @@ public class Requester : OperatorBase, IRequester where TMessag private readonly ConcurrentDictionary _requestTimerDictionary; private Timer _disposeConsumerTimer; private readonly ILogger _logger = LogManager.GetLogger>(); + private bool _channelActive; public Requester( IChannelFactory channelFactory, @@ -91,10 +92,16 @@ private void CreateOrUpdateDisposeTimer() { if (_disposeConsumerTimer != null) { + _channelActive = true; return; } _disposeConsumerTimer = new Timer(state => { + if (_channelActive) + { + _channelActive = false; + return; + } if (!_responseTcsDictionary.IsEmpty) { return;