1
0
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:
Daniel James Smith
2026-01-26 20:29:41 +01:00
parent f017479f0b
commit 00e50db90c

View File

@@ -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());