Fixed email sending logic
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-05-16 00:32:22 +02:00
parent 547f8dd229
commit 53b422433c
5 changed files with 16 additions and 7 deletions
+5 -1
View File
@@ -5,9 +5,13 @@ namespace LiteCharmsScheduler.Workers
{
public class JobWorker(IJobOrchestrator jobOrchestrator, ILogger<JobWorker> logger) : BackgroundService
{
private const string emailProcessorCron = "0 */5 * * * ?";
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
await jobOrchestrator.ScheduleAsync(ProcessEmailNotificationsEvent.Create(), "0 */5 * * * ?", stoppingToken);
var emailProcessorJob = ProcessEmailNotificationsEvent.Create();
await jobOrchestrator.ScheduleAsync(emailProcessorJob, emailProcessorCron, stoppingToken);
logger.LogInformation("Startup jobs scheduled");
}