|
|
|
@@ -114,12 +114,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
// cod app
|
|
|
|
|
CodApp = _configuration["RuntimeOpt:CodApp"];
|
|
|
|
|
|
|
|
|
|
#if false
|
|
|
|
|
// conf cache
|
|
|
|
|
this.memoryCache = memoryCache;
|
|
|
|
|
this.distributedCache = distributedCache;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// conf DB
|
|
|
|
|
string connStr = _configuration.GetConnectionString("GWMS.Data");
|
|
|
|
|
if (string.IsNullOrEmpty(connStr))
|
|
|
|
@@ -216,9 +210,7 @@ namespace GWMS.UI.Data
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
string rawData = JsonConvert.SerializeObject(currTasks);
|
|
|
|
|
await redisDb.StringSetAsync(currHash, rawData);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
answ = true;
|
|
|
|
|
Log.Info($"Re-issued task4machine | idxMacchina: {idxMacchina} | taskKey: {taskKey} | savedVal: {savedVal}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -260,9 +252,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
rawData = JsonConvert.SerializeObject(currTasks);
|
|
|
|
|
await redisDb.StringSetAsync(currHash, rawData);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
Log.Info($"Task ADD | idxMacchina: {idxMacchina} | taskKey: {taskKey} | taskVal: {taskVal}");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exc)
|
|
|
|
@@ -282,9 +271,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
rawData = JsonConvert.SerializeObject(savedTask);
|
|
|
|
|
await redisDb.StringSetAsync(currSavedParHash, rawData);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currSavedParHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case taskType.endProd:
|
|
|
|
@@ -293,9 +279,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
rawData = JsonConvert.SerializeObject(savedTask);
|
|
|
|
|
await redisDb.StringSetAsync(currSavedParHash, rawData);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currSavedParHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
@@ -384,15 +367,9 @@ namespace GWMS.UI.Data
|
|
|
|
|
DateTime adesso = DateTime.Now;
|
|
|
|
|
DateTime vetoCheck = adesso.AddMinutes(1);
|
|
|
|
|
string cacheKey = mHash("CHECKLEVEL");
|
|
|
|
|
#if false
|
|
|
|
|
string cacheKey = "DATA:CHECKLEVEL";
|
|
|
|
|
#endif
|
|
|
|
|
string rawData = "";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
|
|
|
|
|
// se non ho veto --> controllo
|
|
|
|
@@ -410,10 +387,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
// imposto nuovo veto a 5 min...
|
|
|
|
|
vetoCheck = adesso.AddMinutes(5);
|
|
|
|
|
rawData = JsonConvert.SerializeObject(vetoCheck);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, LongCache);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -427,18 +400,12 @@ namespace GWMS.UI.Data
|
|
|
|
|
string source = "DB";
|
|
|
|
|
List<ConfigModel>? dbResult = new List<ConfigModel>();
|
|
|
|
|
string cacheKey = mHash("CONFIG");
|
|
|
|
|
#if false
|
|
|
|
|
string cacheKey = "DATA:CONFIG";
|
|
|
|
|
#endif
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string rawData = "";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<ConfigModel>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
@@ -454,10 +421,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.GetConfig();
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -526,14 +489,8 @@ namespace GWMS.UI.Data
|
|
|
|
|
string cacheKey = currParametersHash(idxMacchina);
|
|
|
|
|
string rawData = "";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
answ = JsonConvert.DeserializeObject<List<objItem>>(rawData);
|
|
|
|
|
// ordino!
|
|
|
|
|
outList = answ
|
|
|
|
@@ -564,14 +521,8 @@ namespace GWMS.UI.Data
|
|
|
|
|
string cacheKey = currParametersHash(idxMacchina);
|
|
|
|
|
string rawData = "";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
actValues = JsonConvert.DeserializeObject<List<objItem>>(rawData);
|
|
|
|
|
// cerco e rimuovo parametri sola lettura o SENZA richieste scrittura
|
|
|
|
|
foreach (var item in actValues)
|
|
|
|
@@ -642,17 +593,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task InvalidateAllCache()
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:CONFIG");
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:CHECKLEVEL");
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:PLANTS:LevelSum");
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:PLANTS:ListDTO");
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:PLANTS:VetoReadDto");
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:SUPPL:List");
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:TRANSP:List");
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:WEEKPLAN:List");
|
|
|
|
|
await distributedCache.RemoveAsync("ParamSend:List");
|
|
|
|
|
#endif
|
|
|
|
|
await FlushRedisCache();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -661,22 +601,13 @@ namespace GWMS.UI.Data
|
|
|
|
|
string source = "DB";
|
|
|
|
|
List<ItemModel>? dbResult = new List<ItemModel>();
|
|
|
|
|
string cacheKey = mHash("ITEMS");
|
|
|
|
|
#if false
|
|
|
|
|
string cacheKey = "DATA:ITEMS";
|
|
|
|
|
#endif
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string rawData = "";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<ItemModel>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -691,10 +622,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.GetItems();
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -715,16 +642,10 @@ namespace GWMS.UI.Data
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string currHash = optParHash(idxMacchina);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(currHash);
|
|
|
|
|
#endif
|
|
|
|
|
string rawData = "";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(currHash);
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
string rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -756,17 +677,10 @@ namespace GWMS.UI.Data
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string cacheKey = savedTaskHash(idxMacchina);
|
|
|
|
|
#if false
|
|
|
|
|
string rawData;
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
string rawData = "";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -962,10 +876,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.ParamSendGetAll();
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -1094,9 +1004,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
bool answ = false;
|
|
|
|
|
string cacheKey = mHash("ParamSend:List");
|
|
|
|
|
// prima di tutto invalido cache dei parametri...
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync("ParamSend:List");
|
|
|
|
|
#endif
|
|
|
|
|
await ExecFlushRedisPattern(cacheKey);
|
|
|
|
|
DateTime adesso = DateTime.Now;
|
|
|
|
|
var currParams = await ParamSendGetAll();
|
|
|
|
@@ -1128,9 +1035,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// alla fine di nuovo invalido cache dei parametri...
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync("ParamSend:List");
|
|
|
|
|
#endif
|
|
|
|
|
await ExecFlushRedisPattern(cacheKey);
|
|
|
|
|
return answ;
|
|
|
|
|
}
|
|
|
|
@@ -1167,28 +1071,18 @@ namespace GWMS.UI.Data
|
|
|
|
|
public async Task<List<PlantDTO>> PlantDtoGetAll()
|
|
|
|
|
{
|
|
|
|
|
List<PlantDTO> dbResult = new List<PlantDTO>();
|
|
|
|
|
string cacheVetoKey = mHash("DATA:PLANTS:VetoReadDto");
|
|
|
|
|
string cacheVetoKey = mHash("PLANTS:VetoReadDto");
|
|
|
|
|
string rawData;
|
|
|
|
|
var rand = new Random();
|
|
|
|
|
// controllo se ci sia semaforo lettura
|
|
|
|
|
#if false
|
|
|
|
|
var redVeto = await distributedCache.GetAsync(cacheVetoKey);
|
|
|
|
|
#endif
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheVetoKey);
|
|
|
|
|
// attendo sino a che non ho scadenza blocco richiesta...
|
|
|
|
|
//while (redVeto != null)
|
|
|
|
|
while (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redVeto);
|
|
|
|
|
#endif
|
|
|
|
|
var vetoDt = JsonConvert.DeserializeObject<DateTime>(rawData);
|
|
|
|
|
if (vetoDt < DateTime.Now)
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:PLANTS:VetoReadDto");
|
|
|
|
|
redVeto = null;
|
|
|
|
|
#endif
|
|
|
|
|
await ExecFlushRedisPattern(cacheVetoKey);
|
|
|
|
|
rawData = "";
|
|
|
|
|
Log.Info("Fine veto attesa");
|
|
|
|
@@ -1197,9 +1091,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
Log.Debug($"Veto attivo per PlantDtoGetAll: salto!");
|
|
|
|
|
// controllo se ci sia semaforo lettura
|
|
|
|
|
#if false
|
|
|
|
|
redVeto = await distributedCache.GetAsync(cacheVetoKey);
|
|
|
|
|
#endif
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheVetoKey);
|
|
|
|
|
// attesa random 1...5 sec
|
|
|
|
|
await Task.Delay(1000 * rand.Next(1, 5));
|
|
|
|
@@ -1207,31 +1098,16 @@ namespace GWMS.UI.Data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// inserisco veto x bloccare!
|
|
|
|
|
#if false
|
|
|
|
|
var vetoData = JsonConvert.SerializeObject(DateTime.Now.AddSeconds(5));
|
|
|
|
|
var serVetoData = Encoding.UTF8.GetBytes(vetoData);
|
|
|
|
|
await distributedCache.SetAsync(cacheVetoKey, serVetoData, cacheOptFast(true));
|
|
|
|
|
#endif
|
|
|
|
|
rawData = JsonConvert.SerializeObject(DateTime.Now.AddSeconds(5));
|
|
|
|
|
await redisDb.StringSetAsync(cacheVetoKey, rawData);
|
|
|
|
|
// proseguo con la vera lettura e serializzazione
|
|
|
|
|
#if false
|
|
|
|
|
string cacheKey = "DATA:PLANTS:ListDTO";
|
|
|
|
|
#endif
|
|
|
|
|
string cacheKey = mHash("DATA:PLANTS:ListDTO");
|
|
|
|
|
string cacheKey = mHash("PLANTS:ListDTO");
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string readSource = "DB";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
dbResult = JsonConvert.DeserializeObject<List<PlantDTO>>(rawData);
|
|
|
|
|
readSource = "REDIS";
|
|
|
|
|
}
|
|
|
|
@@ -1242,18 +1118,11 @@ namespace GWMS.UI.Data
|
|
|
|
|
int.TryParse(_configuration["MaxLogRecord"], out maxRec);
|
|
|
|
|
dbResult = dbController.GetPlantsDTO(maxRec);
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if fakse
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, LongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
|
Log.Debug($"PlantDtoGetAll | {readSource} | {sw.ElapsedMilliseconds} ms");
|
|
|
|
|
// elimino veto!
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync("DATA:PLANTS:VetoReadDto");
|
|
|
|
|
#endif
|
|
|
|
|
await ExecFlushRedisPattern(cacheVetoKey);
|
|
|
|
|
return dbResult;
|
|
|
|
|
}
|
|
|
|
@@ -1274,24 +1143,14 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
string source = "DB";
|
|
|
|
|
List<PlantLogModel> dbResult = new List<PlantLogModel>();
|
|
|
|
|
string cacheKey = mHash($"DATA:PLANTS:LOGS:{PlantId}:{DtMaxDate:yyyyMMddHHmm}:{numRec}");
|
|
|
|
|
#if false
|
|
|
|
|
string cacheKey = $"DATA:PLANTS:LOGS:{PlantId}:{DtMaxDate:yyyyMMddHHmm}:{numRec}";
|
|
|
|
|
#endif
|
|
|
|
|
string cacheKey = mHash($"PLANTS:LOGS:{PlantId}:{DtMaxDate:yyyyMMddHHmm}:{numRec}");
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string rawData = "";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<PlantLogModel>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -1306,10 +1165,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.GetPlantLog(PlantId, DtMaxDate, numRec);
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, LongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -1371,12 +1226,8 @@ namespace GWMS.UI.Data
|
|
|
|
|
fatto = dbController.PlantLogInsertNew(item2insert);
|
|
|
|
|
|
|
|
|
|
// invalido i vari valori in cache
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync($"DATA:PLANTS:LastFlux:{PlantId}");
|
|
|
|
|
await distributedCache.RemoveAsync($"DATA:PLANTS:ListDTO");
|
|
|
|
|
#endif
|
|
|
|
|
await ExecFlushRedisPattern(mHash($"DATA:PLANTS:LastFlux:{PlantId}"));
|
|
|
|
|
await ExecFlushRedisPattern(mHash("DATA:PLANTS:ListDTO"));
|
|
|
|
|
await ExecFlushRedisPattern(mHash($"PLANTS:LastFlux:{PlantId}"));
|
|
|
|
|
await ExecFlushRedisPattern(mHash("PLANTS:ListDTO"));
|
|
|
|
|
Log.Debug($"PlantLogInsert | PlantId: {PlantId} | Completato insert {item2insert.Count} rec");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1387,22 +1238,15 @@ namespace GWMS.UI.Data
|
|
|
|
|
public async Task<List<PlantLevSumDTO>> PlantsAnalisysByFilt(SelectOrderData CurrFilter)
|
|
|
|
|
{
|
|
|
|
|
List<PlantLevSumDTO> dbResult = new List<PlantLevSumDTO>();
|
|
|
|
|
string cacheKey = $"DATA:PLANTS:LevelSum:{CurrFilter.PlantId}:{CurrFilter.DateStart:yyMMdd}:{CurrFilter.DateEnd:yyMMdd}";
|
|
|
|
|
string cacheKey = $"PLANTS:LevelSum:{CurrFilter.PlantId}:{CurrFilter.DateStart:yyMMdd}:{CurrFilter.DateEnd:yyMMdd}";
|
|
|
|
|
string rawData;
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string readSource = "DB";
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
readSource = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<PlantLevSumDTO>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -1417,10 +1261,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.GetPlantLevSumDto(CurrFilter.PlantId, CurrFilter.DateStart, CurrFilter.DateEnd);
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -1431,14 +1271,8 @@ namespace GWMS.UI.Data
|
|
|
|
|
public async Task<bool> PlantsAnalisysReset(SelectOrderData CurrFilter)
|
|
|
|
|
{
|
|
|
|
|
bool answ = false;
|
|
|
|
|
#if false
|
|
|
|
|
string cacheKey = $"DATA:PLANTS:LevelSum:{CurrFilter.PlantId}:{CurrFilter.DateStart:yyMMdd}:{CurrFilter.DateEnd:yyMMdd}";
|
|
|
|
|
#endif
|
|
|
|
|
string cacheKey = mHash($"DATA:PLANTS:LevelSum:{CurrFilter.PlantId}:{CurrFilter.DateStart:yyMMdd}:{CurrFilter.DateEnd:yyMMdd}");
|
|
|
|
|
string cacheKey = mHash($"PLANTS:LevelSum:{CurrFilter.PlantId}:{CurrFilter.DateStart:yyMMdd}:{CurrFilter.DateEnd:yyMMdd}");
|
|
|
|
|
await ExecFlushRedisPattern(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
answ = true;
|
|
|
|
|
return await Task.FromResult(answ);
|
|
|
|
|
}
|
|
|
|
@@ -1459,21 +1293,14 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
string source = "DB";
|
|
|
|
|
List<PlantDetailModel> dbResult = new List<PlantDetailModel>();
|
|
|
|
|
string cacheKey = mHash("DATA:PLANTS:ListModel");
|
|
|
|
|
string cacheKey = mHash("PLANTS:ListModel");
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string rawData;
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<PlantDetailModel>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -1488,10 +1315,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.GetPlants();
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -1538,15 +1361,8 @@ namespace GWMS.UI.Data
|
|
|
|
|
string cacheKey = currParametersHash(idxMacchina);
|
|
|
|
|
string rawData;
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var actValues = JsonConvert.DeserializeObject<List<objItem>>(rawData);
|
|
|
|
|
// cerco e rimuovo
|
|
|
|
|
var remCand = actValues
|
|
|
|
@@ -1558,9 +1374,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
}
|
|
|
|
|
// salvo!
|
|
|
|
|
rawData = JsonConvert.SerializeObject(actValues);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -1584,12 +1397,12 @@ namespace GWMS.UI.Data
|
|
|
|
|
currVal.Remove(taskKey);
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
string rawData = JsonConvert.SerializeObject(currVal);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(currHash, rawData);
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
catch (Exception exc)
|
|
|
|
|
{
|
|
|
|
|
Log.Error($"Errore in remOptPar4Machine | idxMacchina: {idxMacchina} | taskKey: {taskKey}{Environment.NewLine}{exc}");
|
|
|
|
|
}
|
|
|
|
|
return answ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1613,9 +1426,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
currTasks.Remove($"{taskKey}");
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
string rawData = JsonConvert.SerializeObject(currTasks);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(currHash, rawData);
|
|
|
|
|
Log.Info($"Task REM | idxMacchina: {idxMacchina} | taskKey: {taskKey}");
|
|
|
|
|
}
|
|
|
|
@@ -1646,9 +1456,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
string currHash = currMamMapHash(idxMacchina);
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
string rawData = JsonConvert.SerializeObject(currMap);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(currHash, rawData);
|
|
|
|
|
answ = true;
|
|
|
|
|
}
|
|
|
|
@@ -1670,9 +1477,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
string currHash = currParametersHash(idxMacchina);
|
|
|
|
|
// salvo in redis!
|
|
|
|
|
string rawData = JsonConvert.SerializeObject(currValues);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(currHash, rawData);
|
|
|
|
|
// controllo se ha valori write...
|
|
|
|
|
foreach (var item in currValues)
|
|
|
|
@@ -1701,31 +1505,20 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
string source = "DB";
|
|
|
|
|
List<SupplierModel> dbResult = new List<SupplierModel>();
|
|
|
|
|
string cacheKey = mHash("DATA:SUPPL:List");
|
|
|
|
|
string cacheKey = mHash("SUPPL:List");
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string rawData;
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
dbResult = JsonConvert.DeserializeObject<List<SupplierModel>>(rawData);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.GetSuppliers();
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -1751,21 +1544,14 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
string source = "DB";
|
|
|
|
|
List<TransporterModel> dbResult = new List<TransporterModel>();
|
|
|
|
|
string cacheKey = mHash($"DATA:TRANSP:List");
|
|
|
|
|
string cacheKey = mHash($"TRANSP:List");
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string rawData;
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<TransporterModel>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -1780,10 +1566,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
dbResult = dbController.GetTransporters();
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -1876,9 +1658,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
innovations.AddRange(actValues);
|
|
|
|
|
// serializzo e salvo
|
|
|
|
|
string rawData = JsonConvert.SerializeObject(innovations);
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.SetAsync(currHash, Encoding.UTF8.GetBytes(rawData));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(currHash, rawData);
|
|
|
|
|
}
|
|
|
|
|
return answ;
|
|
|
|
@@ -1931,10 +1710,7 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
//dbController.ResetController();
|
|
|
|
|
dbController.WeekPlanDelete(currItem);
|
|
|
|
|
string cacheKey = mHash($"DATA:WEEKPLAN:List");
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
string cacheKey = mHash($"WEEKPLAN:List");
|
|
|
|
|
await ExecFlushRedisPattern(cacheKey);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
@@ -1961,10 +1737,7 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
//dbController.ResetController();
|
|
|
|
|
dbController.WeekPlanUpdate(currItem);
|
|
|
|
|
string cacheKey = $"DATA:WEEKPLAN:List";
|
|
|
|
|
#if false
|
|
|
|
|
await distributedCache.RemoveAsync(cacheKey);
|
|
|
|
|
#endif
|
|
|
|
|
string cacheKey = $"WEEKPLAN:List";
|
|
|
|
|
await ExecFlushRedisPattern(cacheKey);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
@@ -2134,21 +1907,14 @@ namespace GWMS.UI.Data
|
|
|
|
|
string source = "DB";
|
|
|
|
|
List<PlantLogModel>? lastValues = new List<PlantLogModel>();
|
|
|
|
|
// cerco in cache
|
|
|
|
|
string cacheKey = mHash($"DATA:PLANTS:LastFlux:{PlantId}");
|
|
|
|
|
string cacheKey = mHash($"PLANTS:LastFlux:{PlantId}");
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
string rawData;
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<PlantLogModel>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -2164,10 +1930,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
{
|
|
|
|
|
lastValues = dbController.PlantLogGetLastByFlux(PlantId);
|
|
|
|
|
rawData = JsonConvert.SerializeObject(lastValues);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
sw.Stop();
|
|
|
|
@@ -2184,52 +1946,11 @@ namespace GWMS.UI.Data
|
|
|
|
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
|
|
|
private readonly IEmailSender _emailSender;
|
|
|
|
|
private readonly UserManager<IdentityUser> _userManager;
|
|
|
|
|
#if false
|
|
|
|
|
private readonly IDistributedCache distributedCache;
|
|
|
|
|
private readonly IMemoryCache memoryCache;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Durata assoluta massima della cache IN SECONDI (default 300s)
|
|
|
|
|
/// </summary>
|
|
|
|
|
private int chAbsExp = 60 * 5;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Durata della cache IN SECONDI (default 60s) in modalità inattiva (non acceduta) prima di
|
|
|
|
|
/// venire rimossa NON estende oltre il tempo massimo di validità della cache (chAbsExp)
|
|
|
|
|
/// </summary>
|
|
|
|
|
private int chSliExp = 60 * 1;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endregion Private Fields
|
|
|
|
|
|
|
|
|
|
#region Private Methods
|
|
|
|
|
|
|
|
|
|
#if false
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Calcola cache con expyry in modalità fast/slow...
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="fastCache">fast: 1/5 min, slow: 10/50 min</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private DistributedCacheEntryOptions cacheOpt(bool fastCache)
|
|
|
|
|
{
|
|
|
|
|
var numSecAbsExp = fastCache ? chAbsExp : chAbsExp * 10;
|
|
|
|
|
var numSecSliExp = fastCache ? chSliExp : chSliExp * 10;
|
|
|
|
|
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddSeconds(numSecAbsExp)).SetSlidingExpiration(TimeSpan.FromSeconds(numSecSliExp));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cache ultrafast: 1 sec e max 5...
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="fastCache"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private DistributedCacheEntryOptions cacheOptFast(bool fastCache)
|
|
|
|
|
{
|
|
|
|
|
var numSecAbsExp = fastCache ? 5 : chAbsExp * 10;
|
|
|
|
|
var numSecSliExp = fastCache ? 15 : chSliExp * 10;
|
|
|
|
|
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddSeconds(numSecAbsExp)).SetSlidingExpiration(TimeSpan.FromSeconds(numSecSliExp));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Recupera PlantDTO e aggiorno valori attuali (se presente...)
|
|
|
|
|
/// ATTENZIONE: i dati sono sempre ricevuti PER SINGOLO PlantId!!!
|
|
|
|
@@ -2241,19 +1962,12 @@ namespace GWMS.UI.Data
|
|
|
|
|
DateTime adesso = DateTime.Now;
|
|
|
|
|
List<PlantDTO> dbResult = new List<PlantDTO>();
|
|
|
|
|
int PlantId = newItems.FirstOrDefault().PlantId;
|
|
|
|
|
string cacheKey = mHash("DATA:PLANTS:ListDTO");
|
|
|
|
|
string cacheKey = mHash("PLANTS:ListDTO");
|
|
|
|
|
string rawData;
|
|
|
|
|
rawData = await redisDb.StringGetAsync(cacheKey);
|
|
|
|
|
#if false
|
|
|
|
|
var redisDataList = await distributedCache.GetAsync(cacheKey);
|
|
|
|
|
if (redisDataList != null)
|
|
|
|
|
#endif
|
|
|
|
|
if (!string.IsNullOrEmpty(rawData))
|
|
|
|
|
{
|
|
|
|
|
source = "REDIS";
|
|
|
|
|
#if false
|
|
|
|
|
rawData = Encoding.UTF8.GetString(redisDataList);
|
|
|
|
|
#endif
|
|
|
|
|
var tempResult = JsonConvert.DeserializeObject<List<PlantDTO>>(rawData);
|
|
|
|
|
if (tempResult == null)
|
|
|
|
|
{
|
|
|
|
@@ -2325,10 +2039,6 @@ namespace GWMS.UI.Data
|
|
|
|
|
|
|
|
|
|
// salvo DTO!
|
|
|
|
|
rawData = JsonConvert.SerializeObject(dbResult);
|
|
|
|
|
#if false
|
|
|
|
|
redisDataList = Encoding.UTF8.GetBytes(rawData);
|
|
|
|
|
await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(true));
|
|
|
|
|
#endif
|
|
|
|
|
await redisDb.StringSetAsync(cacheKey, rawData, UltraLongCache);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|