diff --git a/src/DotNetCore.CAP/Internal/IConsumerRegister.Default.cs b/src/DotNetCore.CAP/Internal/IConsumerRegister.Default.cs index 4d40380..3928628 100644 --- a/src/DotNetCore.CAP/Internal/IConsumerRegister.Default.cs +++ b/src/DotNetCore.CAP/Internal/IConsumerRegister.Default.cs @@ -46,7 +46,7 @@ namespace DotNetCore.CAP.Internal { _logger = logger; _serviceProvider = serviceProvider; - _options = serviceProvider.GetService>().Value; + _options = serviceProvider.GetRequiredService>().Value; _cts = new CancellationTokenSource(); } @@ -123,7 +123,6 @@ namespace DotNetCore.CAP.Internal { Pulse(); - _cts.Dispose(); _cts = new CancellationTokenSource(); _isHealthy = true;