Aggiunta filtro x sel reparto
This commit is contained in:
@@ -499,7 +499,36 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public Task<List<AnagGruppi>> ElencoGruppiFase()
|
||||
{
|
||||
return Task.FromResult(dbController.AnagGruppiFase());
|
||||
#if false
|
||||
return Task.FromResult(dbController.AnagGruppiFase());
|
||||
#endif
|
||||
List<AnagGruppi> result = new List<AnagGruppi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisAnagGruppi}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagGruppi>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.AnagGruppiFase();
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<AnagGruppi>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ElencoGruppiFase | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
|
||||
public Task<List<LinkMenu>> ElencoLink()
|
||||
@@ -1150,6 +1179,8 @@ namespace MP.SPEC.Data
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private const string redisAnagGruppi = redisBaseAddr + "SPEC:Cache:AnagGruppi";
|
||||
|
||||
private const string redisArtByDossier = redisBaseAddr + "SPEC:Cache:ArtByDossier";
|
||||
|
||||
private const string redisArtList = redisBaseAddr + "SPEC:Cache:ArtList";
|
||||
|
||||
Reference in New Issue
Block a user