private void HandleExit() { try { _reportInformation.HasErrors = true; // Set the current run to be incomplete RecordFailedFeedRun(FeedId); Runner.Finalize(false); } catch { throw; } finally { LoggingHelper.ErrorToNewRelic( "FailedRun", new Dictionary <string, string> { { "Message", "Please view log4net logs for details" } }); Log.Info("Executed HandleExit()!"); Exit(); } }
private void HandleSuccess() { try { RecordSuccessfulFeedRun(_currentRun); if (!Runner.Finalize(true)) { Log.Warn("Finalize processing resulted in error. The outputs that errored out will be retried upon next execution."); LoggingHelper.ErrorToNewRelic( "PartiallyFailedRun", new Dictionary <string, string> { { "Message", "Please view log4net logs for details" } }); } // Remove old jobs RemoveOldJobs(); } catch { throw; } finally { Exit(); } }