Пример #1
0
        public async void RebuildIndex()
        {
            var notifier = new HubContextProgressNotifier(_hubContext, _logger);

            try
            {
                await _indexRebuildService.RebuildIndexAsync(notifier)
                .ConfigureAwait(false);
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Failed to rebuild index");

                await notifier.SendProgressUpdate("ERROR REBUILDING INDEX :( " + e.InnerException, 100)
                .ConfigureAwait(false);
            }
        }
Пример #2
0
        public async Task RebuildIndex()
        {
            try
            {
                _progress = 0;
                await indexRebuildService.RebuildIndexAsync(this);
            }
            catch (Exception e)
            {
                Trace.TraceError(e.ToString());

                Clients.Caller.sendMessage(new ImportProgressMessage
                {
                    Message  = "Failed to rebuild index",
                    Progress = 100
                });
            }
        }
Пример #3
0
        public async void RebuildIndex()
        {
            try
            {
                await _hubContext.Clients.All.SendAsync("UpdateProgress", "Rebuilding index...").ConfigureAwait(false);

                await _indexRebuildService.RebuildIndexAsync()
                .ConfigureAwait(false);
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Failed to rebuild index");

                await _hubContext.Clients.All.SendAsync("UpdateProgress", "ERROR REBUILDING INDEX :( ")
                .ConfigureAwait(false);
            }
            await _hubContext.Clients.All.SendAsync("UpdateProgress", "Index rebuilt!").ConfigureAwait(false);
        }