private static void ShutDown(bool log) { if (!_running) { return; } if (Paused) { throw GetPausedException(); } using (var op = SnTrace.Index.StartOperation("LUCENEMANAGER SHUTDOWN")) { if (_writer != null) { _stopCommitWorker = true; lock (_commitLock) Commit(false); using (var op2 = SnTrace.Index.StartOperation("LM.CloseReaders")) { using (var wrFrame = IndexWriterFrame.Get(true)) // // ShutDown { if (_reader != null) { _reader.Close(); } if (_writer != null) { _writer.Close(); } _running = false; } op2.Successful = true; } op.Successful = true; } } if (log) { SnLog.WriteInformation("LuceneManager has stopped. Max task id and exceptions: " + IndexingActivityQueue.GetCurrentCompletionState()); } }
internal static CompletionState GetCurrent() { return(IndexingActivityQueue.GetCurrentCompletionState()); }