Stable run
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-06-02 00:29:02 +02:00
parent f299e8952a
commit 3d506cffd1
5 changed files with 63 additions and 42 deletions
+2 -13
View File
@@ -1,21 +1,10 @@
using LiteCharms.Features.Quartz.Abstractions;
using LiteCharms.Features.Shop.Notifications.Events;
namespace LiteCharmsScheduler.Workers
{
public class JobWorker(IJobOrchestrator jobOrchestrator, ILogger<JobWorker> logger, IConfiguration configuration) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
string? emailProcessorCron = !string.IsNullOrWhiteSpace(configuration.GetSection("EmailProcessorCron").Value)
? configuration.GetSection("EmailProcessorCron").Value
: "0 */4 * * * ?";
var emailProcessorJob = ProcessEmailNotificationsEvent.Create();
await jobOrchestrator.ScheduleAsync(emailProcessorJob, emailProcessorCron!, stoppingToken);
logger.LogInformation("Startup jobs scheduled");
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken) =>
logger.LogInformation("Midrand Books jobs initialized");
}
}