"Fix-security-and-config-from-TestAgent"
This commit is contained in:
@@ -49,13 +49,13 @@ public class TelegramBotManagerService : BackgroundService, ITelegramBotManagerS
|
||||
}
|
||||
}
|
||||
|
||||
public async Task StartAsync(CancellationToken cancellationToken)
|
||||
public override async Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation("Telegram Bot Manager Service started");
|
||||
await base.StartAsync(cancellationToken);
|
||||
}
|
||||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
public override async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation("Stopping all Telegram bots...");
|
||||
|
||||
@@ -122,15 +122,15 @@ public class TelegramBotManagerService : BackgroundService, ITelegramBotManagerS
|
||||
return false;
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateBotSettingsAsync(Guid botId)
|
||||
public Task<bool> UpdateBotSettingsAsync(Guid botId)
|
||||
{
|
||||
if (_activeBots.TryGetValue(botId, out var botInstance))
|
||||
{
|
||||
// Reload settings from database
|
||||
_logger.LogInformation("Updating settings for bot {BotId}", botId);
|
||||
return true;
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
return false;
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
public Task<int> GetActiveBotCount()
|
||||
@@ -174,7 +174,7 @@ public class TelegramBotManagerService : BackgroundService, ITelegramBotManagerS
|
||||
}
|
||||
}
|
||||
|
||||
private async Task PerformHealthChecksAsync()
|
||||
private Task PerformHealthChecksAsync()
|
||||
{
|
||||
foreach (var kvp in _activeBots)
|
||||
{
|
||||
@@ -189,6 +189,7 @@ public class TelegramBotManagerService : BackgroundService, ITelegramBotManagerS
|
||||
_logger.LogWarning(ex, "Health check failed for bot {BotId}", kvp.Key);
|
||||
}
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user