Completata review senza log verboso e con decimazione dati a 1 h
This commit is contained in:
@@ -613,24 +613,19 @@ namespace GWMS.UI.Data
|
||||
|
||||
// cerco se ho record > valore minimo x ogni flusso ricevuto
|
||||
List<PlantLogModel> insCandidates = newItems.Where(x => x.FluxType == item && x.DtEvent >= dateLimit).OrderBy(x => x.DtEvent).ToList();
|
||||
Log.Trace("PlantLogInsert A");
|
||||
|
||||
int num2ins = insCandidates.Count;
|
||||
while (num2ins > 0)
|
||||
{
|
||||
var newRec = insCandidates.First();
|
||||
Log.Trace($"PlantLogInsert B | PlantId: {newRec.PlantId} | flux {newRec.FluxType} | date limit: {dateLimit} | 01 - {num2ins}");
|
||||
// il primo lo accodo da inserire
|
||||
item2insert.Add(newRec);
|
||||
// calcolo nuovo veto
|
||||
dateLimit = dbController.DateRoundEnd(newRec.DtEvent, IntervalMin);
|
||||
//dateLimit = dbController.DateRoundEnd(newRec.DtEvent.AddMinutes(1), IntervalMin);
|
||||
// ...e se ho record > data limite accodo
|
||||
insCandidates = newItems.Where(x => x.FluxType == item && x.DtEvent > dateLimit).OrderBy(x => x.DtEvent).ToList();
|
||||
num2ins = insCandidates.Count;
|
||||
Log.Trace($"PlantLogInsert C | PlantId: {newRec.PlantId} | flux {newRec.FluxType} | date limit: {dateLimit} | 02 - {num2ins}");
|
||||
}
|
||||
Log.Trace($"PlantLogInsert D DONE");
|
||||
}
|
||||
|
||||
// se ho record da inserire...
|
||||
@@ -638,12 +633,11 @@ namespace GWMS.UI.Data
|
||||
{
|
||||
// faccio vero insert
|
||||
fatto = dbController.PlantLogInsertNew(item2insert);
|
||||
Log.Trace("PlantLogInsert E");
|
||||
|
||||
// invalido i vari valori in cache
|
||||
await distributedCache.RemoveAsync($"DATA:PLANTS:LastFlux:{PlantId}");
|
||||
await distributedCache.RemoveAsync($"DATA:PLANTS:ListDTO");
|
||||
Log.Trace("PlantLogInsert F");
|
||||
Log.Trace($"PlantLogInsert | PlantId: {PlantId} | Completato insert {item2insert.Count} rec");
|
||||
}
|
||||
|
||||
// restituisco
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
"sKey": "M3T@n0"
|
||||
},
|
||||
"TimeoutOffline": 3,
|
||||
"IntervalMin": 2,
|
||||
//"IntervalMin": 60,
|
||||
//"IntervalMin": 2,
|
||||
"IntervalMin": 60,
|
||||
"MaxLogRecord": 360,
|
||||
"ZCodeUrl": "https://qrcode.steamware.net/",
|
||||
"ChartWaitDelay": 10,
|
||||
|
||||
Reference in New Issue
Block a user