Completato salvataggio snapshot + refresh
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
private string searchVal = "";
|
||||
private bool showSearch;
|
||||
private string stateSel = "*";
|
||||
private string tipoSearch = "*";
|
||||
private string tipoSearch = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
|
||||
@@ -274,6 +274,14 @@ namespace MP.SPEC.Data
|
||||
return await Task.FromResult(dbController.ConfigUpdate(updRec));
|
||||
}
|
||||
|
||||
public List<FluxLog> convertToFluxLog(string Valore)
|
||||
{
|
||||
//string valStriped = Valore.Substring(7, Valore.Length - 8);
|
||||
//var result = JsonConvert.DeserializeObject<List<FluxLog>>(valStriped);
|
||||
var result = JsonConvert.DeserializeObject<DossierFluxLogDTO>(Valore);
|
||||
return result.ODL;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
@@ -286,7 +294,7 @@ namespace MP.SPEC.Data
|
||||
/// macchina (ordinato x data registrazione)
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||
/// <param name="DtRef">Data di riferimento (Massima) per estrazioen records</param>
|
||||
/// <param name="DtRef">Data di riferimento (Massima) per estrazione records</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<Dossiers>> DossiersGetLastFilt(string IdxMacchina, DateTime DtRef, int MaxRec)
|
||||
@@ -318,15 +326,26 @@ namespace MP.SPEC.Data
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"DossiersGetLastFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
|
||||
//return await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, DtRef, MaxRec));
|
||||
}
|
||||
public List<FluxLog> convertToFluxLog(string Valore)
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">macchina</param>
|
||||
/// <param name="maxSec">NUm massimo secondi per recuperare dati correnti</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersTakeParamsSnapshot(string IdxMacchina, int MaxSec)
|
||||
{
|
||||
//string valStriped = Valore.Substring(7, Valore.Length - 8);
|
||||
//var result = JsonConvert.DeserializeObject<List<FluxLog>>(valStriped);
|
||||
var result = JsonConvert.DeserializeObject<DossierFluxLogDTO>(Valore);
|
||||
return result.ODL;
|
||||
bool answ = false;
|
||||
await Task.Delay(1);
|
||||
// chiamo stored x salvare parametri
|
||||
dbController.DossiersTakeParamsSnapshot(IdxMacchina, MaxSec);
|
||||
// svuoto cache redis x macchina
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}";
|
||||
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
|
||||
currKey = $"{redisDossByMac}:*";
|
||||
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -593,8 +612,8 @@ namespace MP.SPEC.Data
|
||||
|
||||
private const string redisBaseAddr = "MP:";
|
||||
private const string redisConfKey = redisBaseAddr + "SPEC:Cache:Config";
|
||||
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
|
||||
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
|
||||
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
|
||||
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
|
||||
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
|
||||
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
|
||||
|
||||
Reference in New Issue
Block a user