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; } }