mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Core bug fixes and improvements
This commit is contained in:
@@ -6,8 +6,6 @@ namespace Kruzya.TelegramBot.Core.Extensions
|
||||
public static class StartupExtension
|
||||
{
|
||||
public static IServiceCollection AddQueue<T>(this IServiceCollection collection)
|
||||
{
|
||||
return collection.AddSingleton<ConcurrentQueue<T>>();
|
||||
}
|
||||
=> collection.AddSingleton<ConcurrentQueue<T>>();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user