Fix IOC dataService
This commit is contained in:
@@ -2751,53 +2751,6 @@ namespace MP.IOC.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero PODL da IdxODL
|
||||
/// </summary>
|
||||
/// <param name="idxODL"></param>
|
||||
/// <returns></returns>
|
||||
public PODLModel POdlGetByOdl(int idxODL)
|
||||
{
|
||||
PODLModel result = new PODLModel();
|
||||
if (idxODL != 0)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{Utils.redisPOdlByOdl}:{idxODL}";
|
||||
// cerco in redis dato valOut sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
var rawResult = JsonConvert.DeserializeObject<PODLModel>($"{rawData}");
|
||||
if (rawResult != null)
|
||||
{
|
||||
result = rawResult;
|
||||
}
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = SpecDbController.PODL_getByOdl(idxODL);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new PODLModel();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"POdlGetByOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Debug("Errore IdxODL = 0");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user