예제 #1
0
        protected async override Task ExecuteJobAsync(IJobExecutionContext context)
        {
            _logger.LogInformation(Constants.BypassFiltersEventId, "Execute job task: DeleteDeletedAsync");
            var deleteDate     = DateTime.UtcNow.AddDays(-30);
            var daysAgoSetting = (_adminSettings?.DeleteTrashDaysAgo).GetValueOrDefault();

            if (daysAgoSetting > 0)
            {
                deleteDate = DateTime.UtcNow.AddDays(-1 * daysAgoSetting);
            }
            await _cipherRepository.DeleteDeletedAsync(deleteDate);

            _logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: DeleteDeletedAsync");
        }