Saving events to Events DB : Fixed bugs when connection string was not defined.

This commit is contained in:
Milan Hanajik
2020-11-18 10:44:53 +01:00
parent 3bfb34a6ea
commit 822ef33da8
5 changed files with 14 additions and 30 deletions
@@ -286,7 +286,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
opCompleted = true;
if (SaveTracingRecords(batch) != Retv.OK) anyError = true;
if (anyError)
if (anyError && !string.IsNullOrEmpty(Events.DB.ConnectionString))
{
try
{
@@ -302,17 +302,13 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
}
else
{
if (anyError)
if (anyError && !string.IsNullOrEmpty(Events.DB.ConnectionString))
{
try
{
@@ -328,13 +324,9 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
}
}
else
@@ -347,7 +347,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
opCompleted = true;
}
if (anyError)
if (anyError && !string.IsNullOrEmpty(Events.DB.ConnectionString))
{
try
{
@@ -363,13 +363,9 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
return anyError ? Event.ErrorProcessingResults : Event.ResultsWritten;
}
else
{
@@ -155,7 +155,7 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
opCompleted = true;
}
if (anyError)
if (anyError && !string.IsNullOrEmpty(Events.DB.ConnectionString))
{
try
{
@@ -171,13 +171,9 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
{
log.ErrorFormat("Triggering event(s) failed: {0}", exc.Message);
}
}
return Event.ErrorProcessingResults;
}
else
{
return Event.ResultsWritten;
}
return anyError ? Event.ErrorProcessingResults: Event.ResultsWritten;
}
else
{
@@ -170,7 +170,7 @@ namespace TBF.BenchControl.Various.StatisticsMonitoring
}
}
if (doTriggerEvents)
if (doTriggerEvents && !string.IsNullOrEmpty(Events.DB.ConnectionString))
{
///
/// Trigger events
+1 -1
View File
@@ -199,7 +199,7 @@ namespace TBF.UI.Calendar
log.ErrorFormat("Failed to load or update CustomEvent-s in ServeTriggerEvtCalendarEvents(): {0}", exc.Message);
}
if (eventsToTrigger.Count > 0)
if (eventsToTrigger.Count > 0 && !string.IsNullOrEmpty(global::Events.DB.ConnectionString))
{
try
{