Files
Backend-Api/BackgroundService/Jobs/JobSchedulerRegistrator.cs
2025-07-28 16:02:51 +03:30

23 lines
455 B
C#

using BackgroundService.Services;
using Hangfire;
namespace BackgroundService.Jobs;
public class JobSchedulerRegistrator
{
private readonly ITestService _testService;
public JobSchedulerRegistrator(ITestService testService)
{
_testService = testService;
}
public void Register()
{
RecurringJob.AddOrUpdate(
"job1",
() => _testService.Execute(),
Cron.Hourly
);
}
}