Update conf cache time redis
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
<div class="card shadow">
|
||||
<div class="card-header d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
Andamento chiamate <b>@currDetail</b>
|
||||
History <b>@currDetail</b>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<div class="input-group">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@
|
||||
"RedisWeight": true,
|
||||
"RoutePath": "/api/RIOB",
|
||||
"SafePages": "Index",
|
||||
"redisLongTimeCache": 15,
|
||||
"redisShortTimeCache": 3
|
||||
"redisLongTimeCache": 60,
|
||||
"redisShortTimeCache": 30
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"MP.Data": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; App=MP.IOC;",
|
||||
|
||||
Reference in New Issue
Block a user