Added guardrails around the cluster as well as software level
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-06-03 11:11:22 +02:00
parent a0cf847e51
commit 961f03c1c7
2 changed files with 4 additions and 0 deletions
@@ -18,6 +18,7 @@ public sealed class JobOrchestrator(ISchedulerFactory schedulerFactory) : IJobOr
.WithDescription($"Correlation ID: {notification.CorrelationId}")
.UsingJobData(new JobDataMap { ["Payload"] = JsonSerializer.Serialize(notification) })
.DisallowConcurrentExecution()
.RequestRecovery()
.Build();
var trigger = global::Quartz.TriggerBuilder.Create()
@@ -8,6 +8,9 @@ public sealed class MediatorJob<TNotification>(IMediator mediator) : IJob where
{
public async Task Execute(IJobExecutionContext context)
{
if (context.Recovering)
Trace.WriteLine($"CRITICAL RECOVERY: Resurrecting job '{typeof(TNotification).Name}' after a previous cluster node crashed mid-execution.");
var data = context.MergedJobDataMap["Payload"] as string;
if (string.IsNullOrWhiteSpace(data))