mirror of
https://github.com/bitwarden/server.git
synced 2025-01-02 18:47:44 +01:00
Updated quartz jobs to create a container scope to allow for scoped services (#5131)
This commit is contained in:
parent
c591997d01
commit
2212f552aa
@ -1,4 +1,5 @@
|
||||
using Quartz;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Quartz;
|
||||
using Quartz.Spi;
|
||||
|
||||
namespace Bit.Core.Jobs;
|
||||
@ -14,7 +15,8 @@ public class JobFactory : IJobFactory
|
||||
|
||||
public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
|
||||
{
|
||||
return _container.GetService(bundle.JobDetail.JobType) as IJob;
|
||||
var scope = _container.CreateScope();
|
||||
return scope.ServiceProvider.GetService(bundle.JobDetail.JobType) as IJob;
|
||||
}
|
||||
|
||||
public void ReturnJob(IJob job)
|
||||
|
Loading…
Reference in New Issue
Block a user