From 9d64b5e76d9def69a60a7cdc6d42e60494621873 Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Sun, 10 May 2026 08:20:18 +0200 Subject: [PATCH] Refactored Quartz instance id to AUTO, removed constant --- LiteCharms.Abstractions/Constants.cs | 1 - LiteCharms.Extensions/Quartz.cs | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/LiteCharms.Abstractions/Constants.cs b/LiteCharms.Abstractions/Constants.cs index 80b40a6..31be72a 100644 --- a/LiteCharms.Abstractions/Constants.cs +++ b/LiteCharms.Abstractions/Constants.cs @@ -5,7 +5,6 @@ public static class Constants public const int QueueBounds = 100000; public const string ShopSchedulerName = "shop"; - public const string ShopSchedulerInstanceId = "golden-dawn"; public const string EmailServiceBus = nameof(EmailServiceBus); public const string GeneralServiceBus = nameof(GeneralServiceBus); diff --git a/LiteCharms.Extensions/Quartz.cs b/LiteCharms.Extensions/Quartz.cs index 5f57b6c..a92d462 100644 --- a/LiteCharms.Extensions/Quartz.cs +++ b/LiteCharms.Extensions/Quartz.cs @@ -7,7 +7,7 @@ public static class Quartz { private const string databaseConfigName = "PostgresScheduler"; - public static IServiceCollection AddQuartzSchedulerClient(this IServiceCollection services, string schedulerName, string schedulerId, IConfiguration configuration) + public static IServiceCollection AddQuartzSchedulerClient(this IServiceCollection services, string schedulerName, IConfiguration configuration) { var connectionString = configuration.GetConnectionString(databaseConfigName); @@ -16,7 +16,7 @@ public static class Quartz services.AddQuartz(config => { config.SchedulerName = schedulerName; - config.SchedulerId = schedulerId; + config.SchedulerId = "AUTO"; config.UseSimpleTypeLoader(); config.UseDefaultThreadPool(options => options.MaxConcurrency = 0); @@ -42,7 +42,7 @@ public static class Quartz return services; } - public static IServiceCollection AddQuartzScheduler(this IServiceCollection services, string schedulerName, string schedulerId, IConfiguration configuration) + public static IServiceCollection AddQuartzScheduler(this IServiceCollection services, string schedulerName, IConfiguration configuration) { var connectionString = configuration.GetConnectionString(databaseConfigName); @@ -51,7 +51,7 @@ public static class Quartz services.AddQuartz(config => { config.SchedulerName = schedulerName; - config.SchedulerId = schedulerId; + config.SchedulerId = "AUTO"; config.InterruptJobsOnShutdown = true; config.InterruptJobsOnShutdownWithWait = true; config.MaxBatchSize = 5;