Update conf cache time redis

This commit is contained in:
Samuele Locatelli
2026-04-18 11:48:31 +02:00
parent 9e2ed83a7a
commit 950c2ed87b
3 changed files with 4 additions and 11 deletions
+1 -8
View File
@@ -1730,7 +1730,6 @@ namespace MP.IOC.Data
// 2. Se non c'è in cache, carichiamo/resettiamo tutto
if (val == null)
{
//var data = ResetDatiMacchina(idxMacchina);
var data = await ResetDatiMacchinaAsync(idxMacchina);
data.TryGetValue("insEnabled", out val);
}
@@ -4954,9 +4953,6 @@ namespace MP.IOC.Data
// inizio con un bel reset...
await RedisFlushPatternAsync(pattern);
Dictionary<string, string>? result = new Dictionary<string, string>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
var dbResult = await IocDbController.VMSFDGetByMaccAsync(idxMacc);
// converto in formato dizionario...
@@ -4997,7 +4993,7 @@ namespace MP.IOC.Data
result.Add("Slave", isSlave);
// durata cache in secondi dal valore insEnabled...
double numSecCache = 60 * ((result["insEnabled"].ToLower() == "true") ? redisShortTimeCache / 4 : redisShortTimeCache);
double numSecCache = 60 * ((result["insEnabled"].ToLower() == "true") ? redisShortTimeCache : redisLongTimeCache);
// ...e salvo...
await RedisSetHashDictAsync(currHash, result, numSecCache);
@@ -5005,9 +5001,6 @@ namespace MP.IOC.Data
{
result = new Dictionary<string, string>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"GetCurrMSFDMacc | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}