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,40 @@
using Managing.Application.Workers.Abstractions;
using static Managing.Common.Enums;
namespace Managing.Api.Workers.Workers;
public abstract class PricesBaseWorker<T> : BaseWorker<T> where T : class
{
private readonly IPricesService _pricesService;
private readonly IStatisticService _statisticService;
private readonly Timeframe _timeframe;
public PricesBaseWorker(
ILogger<T> logger,
IPricesService pricesService,
IWorkerService workerService,
IStatisticService statisticService,
TimeSpan delay,
WorkerType workerType,
Timeframe timeframe) : base(
workerType,
logger,
delay,
workerService
)
{
_pricesService = pricesService;
_statisticService = statisticService;
_timeframe = timeframe;
}
protected override async Task Run(CancellationToken cancellationToken)
{
var tickers = _statisticService.GetTickers();
foreach (var ticker in tickers)
{
await _pricesService.UpdatePrice(TradingExchanges.Evm, ticker, _timeframe);
}
}
}