private void RefreshPostprocessorOutput( LogSourceRecordInternal logSourceRecord, PostprocessorOutputRecordInternal postprocessorOutputRecord, ref bool somethingChanged, bool assumeChanged) { LogSourcePostprocessorOutput.Status oldStatus = postprocessorOutputRecord.status; IPostprocessorRunSummary oldSummary = postprocessorOutputRecord.lastRunSummary; bool postprocessorOutputNeedsLoading = assumeChanged || postprocessorOutputRecord.status != LogSourcePostprocessorOutput.Status.Finished; if (postprocessorOutputRecord.postprocessorTask != null) { if (postprocessorOutputRecord.postprocessorTask.IsCompleted) { if (postprocessorOutputRecord.postprocessorTask.GetTaskException() != null) { postprocessorOutputRecord.lastRunSummary = new FailedRunSummary(postprocessorOutputRecord.postprocessorTask.GetTaskException()); } else { var runSummary = postprocessorOutputRecord.postprocessorTask.Result; var logSpecificRunSummary = runSummary?.GetLogSpecificSummary(logSourceRecord.logSource) ?? runSummary; postprocessorOutputRecord.lastRunSummary = logSpecificRunSummary; } postprocessorOutputRecord.ClearPostprocessorTask(); postprocessorOutputNeedsLoading = true; } else { postprocessorOutputRecord.status = LogSourcePostprocessorOutput.Status.InProgress; postprocessorOutputNeedsLoading = false; } } if (postprocessorOutputNeedsLoading) { TryLoadParserOutputAndUpdateStatus(logSourceRecord, postprocessorOutputRecord); } somethingChanged = somethingChanged || (postprocessorOutputRecord.status != oldStatus) || (postprocessorOutputRecord.lastRunSummary != oldSummary); }
public LogSourcePostprocessorOutput BuildData( LogSourcePostprocessorOutput.Status status, double?progress = null, object outputData = null, IPostprocessorRunSummary lastRunSummary = null) { return(new LogSourcePostprocessorOutput { LogSource = logSourceRecord.logSource, LogSourceMeta = logSourceRecord.metadata, PostprocessorMetadata = metadata, OutputStatus = status, Progress = progress, OutputData = outputData, LastRunSummary = lastRunSummary }); }
static bool IsStatusOkToEnableAllPostprocessors(LogSourcePostprocessorOutput.Status value) { return(value != LogSourcePostprocessorOutput.Status.InProgress); }