docker files fixes from liaqat

This commit is contained in:
alirehmani
2024-05-03 16:39:25 +05:00
commit 464a8730e8
587 changed files with 44288 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
using Managing.Application.Abstractions;
using Managing.Application.ManageBot.Commands;
using Managing.Core;
using MediatR;
namespace Managing.Application.ManageBot
{
public class GetActiveBotsCommandHandler : IRequestHandler<GetActiveBotsCommand, List<ITradingBot>>
{
private readonly ITaskCache taskCache;
public GetActiveBotsCommandHandler(ITaskCache taskCache)
{
this.taskCache = taskCache;
}
public Task<List<ITradingBot>> Handle(GetActiveBotsCommand request, CancellationToken cancellationToken)
{
var cachedTask = taskCache.GetCache<AsyncLazy<ITradingBot>>();
var result = new List<ITradingBot>();
foreach (var item in cachedTask)
{
result.Add(item.Value.Result);
}
return Task.FromResult(result);
}
}
}