using Managing.Application.Abstractions.Services;
using Managing.Common;
using Microsoft.Extensions.Logging;

namespace Managing.Application.Workers;

public class FundingRatesWatcher : BaseWorker<FundingRatesWatcher>
{
    private readonly IStatisticService _statisticService;

    public FundingRatesWatcher(
        ILogger<FundingRatesWatcher> logger,
        IServiceProvider serviceProvider,
        IStatisticService statisticService) : base(
        Enums.WorkerType.FundingRatesWatcher,
        logger,
        TimeSpan.FromMinutes(30),
        serviceProvider
    )
    {
        _statisticService = statisticService;
    }

    protected override async Task Run(CancellationToken cancellationToken)
    {
        await _statisticService.UpdateFundingRates();
    }
} 