From 23c7e0ac616251f5344d9d7304e3760a4efc675a Mon Sep 17 00:00:00 2001 From: Marcel Nellesen <nellesen@itc.rwth-aachen.de> Date: Tue, 10 Nov 2020 07:10:10 +0100 Subject: [PATCH] Fix: Included check --- src/KpiGenerator/Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/KpiGenerator/Program.cs b/src/KpiGenerator/Program.cs index f5172c3..b68d52f 100644 --- a/src/KpiGenerator/Program.cs +++ b/src/KpiGenerator/Program.cs @@ -22,6 +22,8 @@ namespace Coscine.KpiGenerator ConsulConfiguration configuration = new ConsulConfiguration(); DataConnection.DefaultSettings = new CoscineSettings(configuration); + var liveMode = configuration.GetStringAndWait("coscine/global/reporting/live"); + // Run all Generators for the KPI // each Generator returns a list of KPI, it can have zero entries. List<Kpi> newKpis = new List<Kpi>(); @@ -42,8 +44,11 @@ namespace Coscine.KpiGenerator var kpiToProcess = kpiModel.GetAllWhere((kpi) => (kpi.SentSuccessfully == false)).ToList(); // try to sent them as a bundle with the csv method - HamsterReporter hamsterReporter = new HamsterReporter(configuration); - hamsterReporter.Send(kpiToProcess); + HamsterReporter hamsterReporter = new HamsterReporter(configuration); + if (liveMode == "1") + { + hamsterReporter.Send(kpiToProcess); + } // if the kpi were sent successful mark all values within the database as successfully sent foreach (Kpi kpi in kpiToProcess) -- GitLab