diff --git a/Core/Extensions/StartupExtension.cs b/Core/Extensions/StartupExtension.cs index 66c357a..cbbbfbd 100644 --- a/Core/Extensions/StartupExtension.cs +++ b/Core/Extensions/StartupExtension.cs @@ -6,8 +6,6 @@ namespace Kruzya.TelegramBot.Core.Extensions public static class StartupExtension { public static IServiceCollection AddQueue(this IServiceCollection collection) - { - return collection.AddSingleton>(); - } + => collection.AddSingleton>(); } } \ No newline at end of file diff --git a/Core/Service/AbstractTimedHostedService.cs b/Core/Service/AbstractTimedHostedService.cs index 30a784c..7566bdd 100644 --- a/Core/Service/AbstractTimedHostedService.cs +++ b/Core/Service/AbstractTimedHostedService.cs @@ -29,7 +29,7 @@ namespace Kruzya.TelegramBot.Core.Service public Task StartAsync(CancellationToken cancellationToken) { _logger.LogInformation("Message sender service is starting."); - _timer = new Timer(Run, null, TimeSpan.Zero, TimeSpan.FromSeconds(1)); + _timer = new Timer(Run, null, TimeSpan.Zero, TimerPeriod); return Task.CompletedTask; } @@ -63,7 +63,7 @@ namespace Kruzya.TelegramBot.Core.Service } finally { - var timerPeriod = this.TimerPeriod; + var timerPeriod = TimerPeriod; _timer?.Change(timerPeriod, timerPeriod); } }