2018-10-09 16:12:27 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Bit.Core.Jobs;
|
|
|
|
|
using Bit.Core.Repositories;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Quartz;
|
|
|
|
|
|
|
|
|
|
namespace Bit.Admin.Jobs
|
|
|
|
|
{
|
|
|
|
|
public class DatabaseRebuildlIndexesJob : BaseJob
|
|
|
|
|
{
|
|
|
|
|
private readonly IMaintenanceRepository _maintenanceRepository;
|
|
|
|
|
|
|
|
|
|
public DatabaseRebuildlIndexesJob(
|
|
|
|
|
IMaintenanceRepository maintenanceRepository,
|
2018-10-09 20:42:11 +02:00
|
|
|
|
ILogger<DatabaseRebuildlIndexesJob> logger)
|
2018-10-09 16:12:27 +02:00
|
|
|
|
: base(logger)
|
|
|
|
|
{
|
|
|
|
|
_maintenanceRepository = maintenanceRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected async override Task ExecuteJobAsync(IJobExecutionContext context)
|
|
|
|
|
{
|
|
|
|
|
await _maintenanceRepository.RebuildIndexesAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|