Fix conf key redis cache:
- era overlapping parametri/dossiers
This commit is contained in:
@@ -295,7 +295,7 @@ namespace MP.SPEC.Data
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisFluxByMac}:{IdxMacchina}";
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
@@ -308,7 +308,7 @@ namespace MP.SPEC.Data
|
||||
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, DtRef, MaxRec));
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
@@ -316,7 +316,7 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ParametriGetFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
Log.Debug($"DossiersGetLastFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
|
||||
//return await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, DtRef, MaxRec));
|
||||
@@ -594,6 +594,7 @@ 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 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