Skip to content

Commit

Permalink
Update Quartz services to Singleton
Browse files Browse the repository at this point in the history
Changed QuartzWorkflowScheduler and QuartzCronParser to singleton services to ensure a single instance is used throughout the application. This modification aims to improve resource management and consistency in scheduling operations.
  • Loading branch information
sfmskywalker committed Nov 5, 2024
1 parent 98d914f commit 3dec206
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/Elsa.Quartz/Features/QuartzSchedulerFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public override void Configure()
public override void Apply()
{
Services.AddSingleton<IActivityDescriptorModifier, CronActivityDescriptorModifier>();
Services.AddScoped<QuartzWorkflowScheduler>();
Services.AddScoped<QuartzCronParser>();
Services.AddSingleton<QuartzCronParser>();
Services.AddSingleton<QuartzWorkflowScheduler>();
Services.AddQuartz(quartz => quartz
.AddJob<RunWorkflowJob>(job => job.WithIdentity(RunWorkflowJob.JobKey).StoreDurably())
.AddJob<ResumeWorkflowJob>(job => job.WithIdentity(ResumeWorkflowJob.JobKey).StoreDurably()));
Expand Down

0 comments on commit 3dec206

Please sign in to comment.