diff --git a/LiteCharms.Features/Quartz/JobOrchestrator.cs b/LiteCharms.Features/Quartz/JobOrchestrator.cs index 7873683..4929543 100644 --- a/LiteCharms.Features/Quartz/JobOrchestrator.cs +++ b/LiteCharms.Features/Quartz/JobOrchestrator.cs @@ -50,7 +50,7 @@ public class JobOrchestrator(ISchedulerFactory schedulerFactory) : IJobOrchestra var trigger = global::Quartz.TriggerBuilder.Create() .WithIdentity(triggerKey) - .WithDescription($"Scheduled via Main Job at {now:g} UTC") + .WithDescription($"Scheduled via Main Job at {now:g}") .WithCronSchedule(cronExpression, cron => cron .WithMisfireHandlingInstructionIgnoreMisfires()) .StartAt(now) diff --git a/LiteCharms.Features/Quartz/MediatorJob.cs b/LiteCharms.Features/Quartz/MediatorJob.cs index f67dda1..9b52972 100644 --- a/LiteCharms.Features/Quartz/MediatorJob.cs +++ b/LiteCharms.Features/Quartz/MediatorJob.cs @@ -10,16 +10,28 @@ public class MediatorJob(IMediator mediator) : IJob where TNotifi { var data = context.MergedJobDataMap["Payload"] as string; - if (string.IsNullOrWhiteSpace(data)) return; + if (string.IsNullOrWhiteSpace(data)) + { + Trace.WriteLine("Job Payload missing, job ended"); + + return; + } var notification = JsonSerializer.Deserialize(data); - if (notification is null) return; + if (notification is null) + { + Trace.WriteLine("Notification could not be JSon converted from data string, job ended"); + + return; + } using var activity = MediatorTelemetry.Source.StartActivity($"Quartz: {typeof(TNotification).Name}"); activity?.SetTag("event.correlation_id", notification.CorrelationId); await mediator.Publish(notification, context.CancellationToken); + + Trace.WriteLine("Job published"); } }