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); } }
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 }); } }
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); }