1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-17 07:30:59 -05:00
Files
bitwarden/src/Api/Auth/Jobs/EmergencyAccessNotificationJob.cs
2025-07-08 10:25:41 -04:00

27 lines
883 B
C#

// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using Bit.Core.Auth.Services;
using Bit.Core.Jobs;
using Quartz;
namespace Bit.Api.Auth.Jobs;
public class EmergencyAccessNotificationJob : BaseJob
{
private readonly IServiceScopeFactory _serviceScopeFactory;
public EmergencyAccessNotificationJob(IServiceScopeFactory serviceScopeFactory, ILogger<EmergencyAccessNotificationJob> logger)
: base(logger)
{
_serviceScopeFactory = serviceScopeFactory;
}
protected override async Task ExecuteJobAsync(IJobExecutionContext context)
{
using var scope = _serviceScopeFactory.CreateScope();
var emergencyAccessService = scope.ServiceProvider.GetService(typeof(IEmergencyAccessService)) as IEmergencyAccessService;
await emergencyAccessService.SendNotificationsAsync();
}
}