Update Agent balance tracking
This commit is contained in:
@@ -208,6 +208,28 @@ namespace Managing.Application.ManageBot
|
||||
return await grain.GetConfiguration();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<TradingBotConfig>> GetBotConfigsByIdsAsync(IEnumerable<Guid> botIds)
|
||||
{
|
||||
var configs = new List<TradingBotConfig>();
|
||||
|
||||
foreach (var botId in botIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
var grain = _grainFactory.GetGrain<ILiveTradingBotGrain>(botId);
|
||||
var config = await grain.GetConfiguration();
|
||||
configs.Add(config);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_tradingBotLogger.LogWarning(ex, "Failed to get configuration for bot {BotId}", botId);
|
||||
// Continue with other bots even if one fails
|
||||
}
|
||||
}
|
||||
|
||||
return configs;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<string>> GetActiveBotsNamesAsync()
|
||||
{
|
||||
var bots = await _botRepository.GetBotsByStatusAsync(BotStatus.Running);
|
||||
|
||||
Reference in New Issue
Block a user