mirror of
https://github.com/bitwarden/server
synced 2026-02-14 07:23:26 +00:00
Fix startup by assigning the jobFactory manually
This commit is contained in:
@@ -42,8 +42,7 @@ public abstract class BaseJobsHostedService : IHostedService, IDisposable
|
||||
}
|
||||
var schedulerBuilder = SchedulerBuilder.Create()
|
||||
.WithName(fullName) // Ensure each project has a unique instanceName
|
||||
.WithId("AUTO")
|
||||
.UseJobFactory<JobFactory>();
|
||||
.WithId("AUTO");
|
||||
|
||||
if (!string.IsNullOrEmpty(_globalSettings.SqlServer.JobSchedulerConnectionString))
|
||||
{
|
||||
@@ -58,6 +57,7 @@ public abstract class BaseJobsHostedService : IHostedService, IDisposable
|
||||
|
||||
var factory = schedulerBuilder.Build();
|
||||
_scheduler = await factory.GetScheduler(cancellationToken);
|
||||
_scheduler.JobFactory = new JobFactory(_serviceProvider);
|
||||
|
||||
_scheduler.ListenerManager.AddJobListener(new JobListener(_listenerLogger), GroupMatcher<JobKey>.AnyGroup());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user