Files
managing-apps/src/Managing.Api.Workers/Workers/LeaderboardWorker.cs
2025-05-16 22:30:18 +07:00

30 lines
867 B
C#

using Managing.Application.Abstractions.Services;
using Managing.Application.Workers;
using Managing.Application.Workers.Abstractions;
using static Managing.Common.Enums;
namespace Managing.Api.Workers.Workers;
public class LeaderboardWorker : BaseWorker<FeeWorker>
{
private readonly IStatisticService _statisticService;
private static readonly WorkerType _workerType = WorkerType.LeaderboardWorker;
public LeaderboardWorker(
ILogger<FeeWorker> logger,
IStatisticService statisticService,
IWorkerService workerService) : base(
_workerType,
logger,
TimeSpan.FromHours(24),
workerService
)
{
_statisticService = statisticService;
}
protected override async Task Run(CancellationToken cancellationToken)
{
await _statisticService.UpdateLeaderboard();
}
}