diff --git a/src/KpiGenerator/Program.cs b/src/KpiGenerator/Program.cs index f5172c359e83e41712491c445f89e8c0438f6d56..b68d52ff3d622762b71cd239ffa59872dd2b5c15 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)