From 0f91f102e576fc1f7a76cca21d3c02f3225baec1 Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Fri, 15 May 2026 09:51:26 +0200 Subject: [PATCH] Optimised quartz --- LiteCharms.Features/Extensions/Quartz.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/LiteCharms.Features/Extensions/Quartz.cs b/LiteCharms.Features/Extensions/Quartz.cs index e22b1ca..28299e8 100644 --- a/LiteCharms.Features/Extensions/Quartz.cs +++ b/LiteCharms.Features/Extensions/Quartz.cs @@ -34,7 +34,7 @@ public static class Quartz storage.UseClustering(cluster => { cluster.CheckinInterval = TimeSpan.FromSeconds(30); - cluster.CheckinMisfireThreshold = TimeSpan.FromSeconds(2); + cluster.CheckinMisfireThreshold = TimeSpan.FromSeconds(20); }); }); }); @@ -48,6 +48,8 @@ public static class Quartz services.ConfigureCommon(); + services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true); + services.AddQuartz(config => { config.SchedulerName = schedulerName; @@ -72,7 +74,7 @@ public static class Quartz storage.UseClustering(cluster => { cluster.CheckinInterval = TimeSpan.FromSeconds(30); - cluster.CheckinMisfireThreshold = TimeSpan.FromSeconds(2); + cluster.CheckinMisfireThreshold = TimeSpan.FromSeconds(20); }); }); }); @@ -86,14 +88,14 @@ public static class Quartz { options.Scheduling.IgnoreDuplicates = true; options.Scheduling.OverWriteExistingData = true; + options["quartz.plugin.jobHistory.type"] = "Quartz.Plugin.History.LoggingJobHistoryPlugin, Quartz.Plugins"; options["quartz.plugin.triggerHistory.type"] = "Quartz.Plugin.History.LoggingTriggerHistoryPlugin, Quartz.Plugins"; }); services.AddTransient(); services.AddTransient(); - services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true); - + return services; } }