Fix Backup and fix worker discord
This commit is contained in:
@@ -173,15 +173,21 @@ namespace Managing.Application.ManageBot
|
||||
return Enums.BotStatus.Down.ToString();
|
||||
}
|
||||
|
||||
public Task<bool> DeleteBot(string botName)
|
||||
public async Task<bool> DeleteBot(string botName)
|
||||
{
|
||||
if (_botTasks.TryRemove(botName, out _))
|
||||
if (_botTasks.TryRemove(botName, out var botWrapper))
|
||||
{
|
||||
if (botWrapper.BotInstance is IBot bot)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
bot.Stop()); // Assuming Stop is an asynchronous process wrapped in Task.Run for synchronous methods
|
||||
}
|
||||
|
||||
_botRepository.DeleteBotBackup(botName);
|
||||
return Task.FromResult(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return Task.FromResult(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
public Task<string> RestartBot(string botName)
|
||||
|
||||
Reference in New Issue
Block a user