private void OnInstanceOnBuildingEmptyIndexOnStartup(object sender, BuildingEmptyIndexOnStartupEventArgs args) { //store the indexer that needs rebuilding because it's empty for when the boot process // is complete and cancel this current event so the rebuild process doesn't start right now. args.Cancel = true; _indexesToRebuild.Add(args.Indexer); }
private void OnInstanceOnBuildingEmptyIndexOnStartup(object sender, BuildingEmptyIndexOnStartupEventArgs args) { //store the indexer that needs rebuilding because it's empty for when the boot process // is complete and cancel this current event so the rebuild process doesn't start right now. args.Cancel = true; _indexesToRebuild.Add((BaseIndexProvider)args.Indexer); //check if the index is rebuilding due to an error and log it if (args.IsHealthy == false) { var baseIndex = args.Indexer as BaseIndexProvider; var name = baseIndex != null ? baseIndex.Name : "[UKNOWN]"; _profilingLogger.Logger.Error <ExamineStartup>(string.Format("The index {0} is rebuilding due to being unreadable/corrupt", name), args.UnhealthyException); } }