protected override async Task <JobResult> RunInternalAsync(JobContext context)
        {
            await _configuration.ConfigureIndexesAsync(null, false).AnyContext();

            await _migrationManager.RunAsync().AnyContext();

            var tasks = _configuration.Indexes.OfType <VersionedIndex>().Select(ReindexIfNecessary);
            await Task.WhenAll(tasks).AnyContext();

            return(JobResult.Success);
        }
        protected async Task ResetAllAsync()
        {
            var oldLoggingLevel = Log.MinimumLevel;

            Log.MinimumLevel = LogLevel.Warning;

            await _configuration.DeleteIndexesAsync();

            var cacheClient = GetService <ICacheClient>();
            await cacheClient.RemoveAllAsync().AnyContext();

            var fileStorage = GetService <IFileStorage>();
            await fileStorage.DeleteFilesAsync(await fileStorage.GetFileListAsync().AnyContext());

            await GetService <IQueue <MailMessage> >().DeleteQueueAsync().AnyContext();
            await GetService <IQueue <WorkItemData> >().DeleteQueueAsync().AnyContext();

            Log.MinimumLevel = oldLoggingLevel;
            await _configuration.ConfigureIndexesAsync().AnyContext();
        }