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 class StartupExtension
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddQueue<T>(this IServiceCollection collection)
|
public static IServiceCollection AddQueue<T>(this IServiceCollection collection)
|
||||||
{
|
=> collection.AddSingleton<ConcurrentQueue<T>>();
|
||||||
return collection.AddSingleton<ConcurrentQueue<T>>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ namespace Kruzya.TelegramBot.Core.Service
|
|||||||
public Task StartAsync(CancellationToken cancellationToken)
|
public Task StartAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Message sender service is starting.");
|
_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;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ namespace Kruzya.TelegramBot.Core.Service
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
var timerPeriod = this.TimerPeriod;
|
var timerPeriod = TimerPeriod;
|
||||||
_timer?.Change(timerPeriod, timerPeriod);
|
_timer?.Change(timerPeriod, timerPeriod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user