refactor: inject IScheduler via DI instead of using StdSchedulerFactory directly
This commit is contained in:
parent
89ec887510
commit
86c9fdfcd7
@ -72,6 +72,10 @@ try
|
||||
});
|
||||
|
||||
builder.Services.AddQuartzmon();
|
||||
|
||||
builder.Services.AddSingleton(provider =>
|
||||
provider.GetRequiredService<ISchedulerFactory>().GetScheduler().Result
|
||||
);
|
||||
#endregion
|
||||
|
||||
#region Add DB Context, EG Inf. and Services
|
||||
@ -132,7 +136,7 @@ try
|
||||
|
||||
app.UseQuartzmon(new QuartzmonOptions()
|
||||
{
|
||||
Scheduler = StdSchedulerFactory.GetDefaultScheduler().Result,
|
||||
Scheduler = app.Services.GetRequiredService<IScheduler>(),
|
||||
VirtualPathRoot = "/quartz"
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user