commit parziale (OK SOLO SE niente F5)
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
<div class="col-4">
|
||||
<span>
|
||||
<button class="btn btn-sm @ResetClass" @onclick="() => ForceReload()" title="Update"><i class="fa-solid fa-rotate"></i></button>
|
||||
Username
|
||||
@UserName
|
||||
</span>
|
||||
<sub>[999]</sub>
|
||||
<sub>[@MatrOpr]</sub>
|
||||
</div>
|
||||
<div class="col-4 text-center d-flex justify-content-center">
|
||||
<a href="status-map" class="text-decoration-none text-light">
|
||||
|
||||
@@ -71,12 +71,21 @@ namespace MP_TAB_SERV.Components
|
||||
NavMan.NavigateTo("/", true);
|
||||
}
|
||||
|
||||
private string UserName
|
||||
{
|
||||
get => MsgServ.CognomeNome;
|
||||
}
|
||||
private int MatrOpr
|
||||
{
|
||||
get => MsgServ.MatrOpr;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
CurrOprTknLS = await MsgServ.getCurrOperDtoAsync();
|
||||
var decodedUrl = Uri.UnescapeDataString(CurrOprTknLS);
|
||||
CurrOprTknRedis = await TDService.OperatoreGetRedis(MsgServ.MatrOpr);
|
||||
CurrOprTknRedis = await TDService.OperatoreGetRedis(MatrOpr);
|
||||
if (CurrOprTknRedis == "")
|
||||
{
|
||||
if (!NavMan.Uri.Contains("reg-new-device"))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2311.1411</Version>
|
||||
<Version>6.16.2311.1412</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace MP_TAB_SERV.Pages
|
||||
await Task.Delay(1);
|
||||
await localStorage.SetItemAsync("currTkn", "");
|
||||
await TDService.OperatoreDeleteRedis(MsgServ.MatrOpr);
|
||||
NavMan.NavigateTo("regnewdevice");
|
||||
NavMan.NavigateTo("reg-new-device");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/regnewdevice"
|
||||
@page "/reg-new-device"
|
||||
@using ZXingBlazor.Components
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace MP_TAB_SERV.Pages
|
||||
protected async Task logIn()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
rigaOpr = await TDService.LoginOperatore(matrOpr, authKey);
|
||||
rigaOpr = await TDService.OperatoreSearch(matrOpr, authKey);
|
||||
if (rigaOpr != null)
|
||||
{
|
||||
userTknDTO newUserTkn = new userTknDTO()
|
||||
@@ -72,7 +72,7 @@ namespace MP_TAB_SERV.Pages
|
||||
};
|
||||
|
||||
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
|
||||
string hash = TDService.EncriptData(jsonTkn);
|
||||
string hash = TDService.EncryptData(jsonTkn);
|
||||
MsgServ.RigaOper = rigaOpr;
|
||||
await MsgServ.setCurrOperDtoAsync(hash);
|
||||
await TDService.OperatoreSetRedis(matrOpr, hash);
|
||||
@@ -117,11 +117,11 @@ namespace MP_TAB_SERV.Pages
|
||||
}
|
||||
|
||||
|
||||
rigaOpr = await TDService.LoginOperatore(matrOpr, authKey);
|
||||
rigaOpr = await TDService.OperatoreSearch(matrOpr, authKey);
|
||||
if (rigaOpr == null)
|
||||
{
|
||||
var deHash = TDService.DeriptData(authKey);
|
||||
rigaOpr = await TDService.LoginOperatore(matrOpr, deHash);
|
||||
var deHash = TDService.DecryptData(authKey);
|
||||
rigaOpr = await TDService.OperatoreSearch(matrOpr, deHash);
|
||||
}
|
||||
if (rigaOpr != null)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ namespace MP_TAB_SERV.Pages
|
||||
};
|
||||
|
||||
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
|
||||
string hash = TDService.EncriptData(jsonTkn);
|
||||
string hash = TDService.EncryptData(jsonTkn);
|
||||
MsgServ.RigaOper = rigaOpr;
|
||||
await MsgServ.setCurrOperDtoAsync(hash);
|
||||
await TDService.OperatoreSetRedis(matrOpr, hash);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2311.1411</h4>
|
||||
<h4>Versione: 6.16.2311.1412</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2311.1411
|
||||
6.16.2311.1412
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2311.1411</version>
|
||||
<version>6.16.2311.1412</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
public static string redisMseKey = "MP:MON:Cache:MSE";
|
||||
public static string redisMseKeySingle = "MP:MON:Cache:MseSingle";
|
||||
|
||||
// passphrase cifratura
|
||||
public const string passPhrase = "7871D817-C71F-4DFC-BF12-00A95BE507B5";
|
||||
|
||||
#endregion Public Fields
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ namespace MP.Data.Controllers
|
||||
/// /// <param name="matrOpr"></param>
|
||||
/// /// <param name="authKey"></param>
|
||||
/// <returns></returns>
|
||||
public AnagOperatoriModel LoginOperatore(int matrOpr, string authKey)
|
||||
public AnagOperatoriModel OperatoreSearch(int matrOpr, string authKey)
|
||||
{
|
||||
AnagOperatoriModel dbResult = null;
|
||||
AnagOperatoriModel answ = new AnagOperatoriModel();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Blazored.LocalStorage;
|
||||
using Blazored.SessionStorage;
|
||||
using EgwCoreLib.Utils;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
@@ -93,8 +94,7 @@ namespace MP.Data.Services
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 102;
|
||||
//int answ = -1;
|
||||
int answ = -1;
|
||||
if (_rigaOper != null)
|
||||
{
|
||||
answ = _rigaOper.MatrOpr;
|
||||
@@ -410,7 +410,45 @@ namespace MP.Data.Services
|
||||
|
||||
#region Private Fields
|
||||
|
||||
public string DecryptData(string encData)
|
||||
{
|
||||
return SteamCrypto.DecryptString(encData, Constants.passPhrase);
|
||||
}
|
||||
|
||||
private AnagOperatoriModel? _rigaOper;
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// AnagOperatoriModel answ = new AnagOperatoriModel();
|
||||
// string rawData = "";
|
||||
// var pUpd = Task.Run(async () =>
|
||||
// {
|
||||
// rawData = await getCurrOperDtoAsync();
|
||||
// });
|
||||
// pUpd.Wait();
|
||||
// var decodedUrl = Uri.UnescapeDataString(rawData);
|
||||
// var decrData = DecryptData(decodedUrl);
|
||||
// answ = JsonConvert.DeserializeObject<AnagOperatoriModel>(decodedUrl);
|
||||
// return answ;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// var serVal = JsonConvert.SerializeObject(value);
|
||||
// var encData = EncryptData(serVal);
|
||||
// var escdata = Uri.EscapeDataString(encData);
|
||||
// var pUpd = Task.Run(async () =>
|
||||
// {
|
||||
// await setCurrOperDtoAsync(escdata);
|
||||
// });
|
||||
// pUpd.Wait();
|
||||
// }
|
||||
//}
|
||||
public string EncryptData(string rawData)
|
||||
{
|
||||
return SteamCrypto.EncryptString(rawData, Constants.passPhrase);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache lunga IN SECONDI
|
||||
|
||||
+177
-188
@@ -176,41 +176,6 @@ namespace MP.Data.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco operatori
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagOperatoriModel>> ElencoOperatori()
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<AnagOperatoriModel>? result = new List<AnagOperatoriModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:ElencoOpr";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagOperatoriModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbTabController.ElencoOperatori();
|
||||
// serializzo e salvo...
|
||||
//rawData = JsonConvert.SerializeObject(result);
|
||||
//await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<AnagOperatoriModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"ElencoOperatori | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registrato ACK allarme
|
||||
/// </summary>
|
||||
@@ -224,159 +189,6 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
public string EncriptData(string rawData)
|
||||
{
|
||||
return SteamCrypto.EncryptString(rawData, passPhrase);
|
||||
}
|
||||
public string DeriptData(string encData)
|
||||
{
|
||||
return SteamCrypto.DecryptString(encData, passPhrase);
|
||||
}
|
||||
|
||||
protected const string passPhrase = "7871D817-C71F-4DFC-BF12-00A95BE507B5";
|
||||
|
||||
protected int expDays = 1;
|
||||
|
||||
protected void setExpDays()
|
||||
{
|
||||
ConfigGetVal("cookieDayExpire", ref expDays);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log in operatore
|
||||
/// </summary>
|
||||
/// <param name="matrOpr">matricola operatore</param>
|
||||
/// <param name="authKey">Auth Key</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AnagOperatoriModel> LoginOperatore(int matrOpr, string authKey)
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
AnagOperatoriModel answ = null;
|
||||
// cerco in redis...
|
||||
//string currKey = $"{redisBaseKey}:CurrOpr:login:{matrOpr}";
|
||||
//RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
//if (rawData.HasValue)
|
||||
//{
|
||||
//var encrData = SteamCrypto.DecryptString(rawData, passPhrase);
|
||||
//answ = JsonConvert.DeserializeObject<AnagOperatoriModel>($"{rawData}");
|
||||
//source = "REDIS";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// serializzo e salvo...
|
||||
//rawData = JsonConvert.SerializeObject(answ);
|
||||
//var encrData = SteamCrypto.EncryptString(rawData, passPhrase);
|
||||
//await redisDb.StringSetAsync(currKey, rawData, ConfigCache);
|
||||
//}
|
||||
answ = dbTabController.LoginOperatore(matrOpr, authKey);
|
||||
if (answ == null)
|
||||
{
|
||||
answ = new AnagOperatoriModel();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"LoginOperatore | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scrive l'hash dell'oggetto curr opr
|
||||
/// </summary>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> OperatoreGetRedis(int matrOpr)
|
||||
{
|
||||
string source = "REDIS";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string answ = "";
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
//var encrData = SteamCrypto.DecryptString(rawData, passPhrase);
|
||||
//answ = JsonConvert.DeserializeObject<string>(rawData);
|
||||
answ = rawData;
|
||||
}
|
||||
if (answ == null)
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OperatoreGetRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete dell'oggetto opr serializzato
|
||||
/// </summary>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> OperatoreDeleteRedis(int matrOpr)
|
||||
{
|
||||
string source = "REDIS";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
bool answ = false;
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:CurrOpr:{matrOpr}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
var done = await ExecFlushRedisPattern(currKey);
|
||||
if (done)
|
||||
{
|
||||
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OperatoreDeleteRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// legge l'hash dell'oggetto curr opr
|
||||
/// </summary>
|
||||
/// <param name="currOpr"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> OperatoreSetRedis(int matrOpr, string currOpr)
|
||||
{
|
||||
string source = "REDIS";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string answ = "";
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
|
||||
//RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
// serializzo e salvo...
|
||||
//rawData = JsonConvert.SerializeObject(currOpr);
|
||||
answ = currOpr;
|
||||
//var encrData = SteamCrypto.EncryptString(rawData, passPhrase);
|
||||
await redisDb.StringSetAsync(currKey, currOpr, ConfigCache);
|
||||
if (answ == null)
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OperatoreSetRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache data dal valore in config
|
||||
/// </summary>
|
||||
protected TimeSpan ConfigCache
|
||||
{
|
||||
get => TimeSpan.FromDays(expDays);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registrato ACK allarme
|
||||
/// </summary>
|
||||
@@ -755,6 +567,11 @@ namespace MP.Data.Services
|
||||
return dbTabController.DDB_getNext(idxMacchina, inizioStato);
|
||||
}
|
||||
|
||||
public string DecryptData(string encData)
|
||||
{
|
||||
return SteamCrypto.DecryptString(encData, Constants.passPhrase);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
@@ -786,6 +603,45 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco operatori
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagOperatoriModel>> ElencoOperatori()
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<AnagOperatoriModel>? result = new List<AnagOperatoriModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:ElencoOpr";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagOperatoriModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbTabController.ElencoOperatori();
|
||||
// serializzo e salvo...
|
||||
//rawData = JsonConvert.SerializeObject(result);
|
||||
//await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<AnagOperatoriModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"ElencoOperatori | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
public string EncryptData(string rawData)
|
||||
{
|
||||
return SteamCrypto.EncryptString(rawData, Constants.passPhrase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elimina una riga in EventList se trovata
|
||||
/// </summary>
|
||||
@@ -1708,6 +1564,116 @@ namespace MP.Data.Services
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete dell'oggetto opr serializzato
|
||||
/// </summary>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> OperatoreDeleteRedis(int matrOpr)
|
||||
{
|
||||
string source = "REDIS";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
bool answ = false;
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
var done = await ExecFlushRedisPattern(currKey);
|
||||
if (done)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OperatoreDeleteRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scrive l'hash dell'oggetto curr opr
|
||||
/// </summary>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> OperatoreGetRedis(int matrOpr)
|
||||
{
|
||||
string source = "REDIS";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string answ = "";
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
//var encrData = SteamCrypto.DecryptString(rawData, passPhrase);
|
||||
//answ = JsonConvert.DeserializeObject<string>(rawData);
|
||||
answ = rawData;
|
||||
}
|
||||
if (answ == null)
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OperatoreGetRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log in operatore
|
||||
/// </summary>
|
||||
/// <param name="matrOpr">matricola operatore</param>
|
||||
/// <param name="authKey">Auth Key</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AnagOperatoriModel> OperatoreSearch(int matrOpr, string authKey)
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
AnagOperatoriModel answ = null;
|
||||
answ = dbTabController.OperatoreSearch(matrOpr, authKey);
|
||||
if (answ == null)
|
||||
{
|
||||
answ = new AnagOperatoriModel();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"LoginOperatore | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// legge l'hash dell'oggetto curr opr
|
||||
/// </summary>
|
||||
/// <param name="currOpr"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> OperatoreSetRedis(int matrOpr, string currOpr)
|
||||
{
|
||||
string source = "REDIS";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string answ = "";
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
|
||||
//RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
// serializzo e salvo...
|
||||
//rawData = JsonConvert.SerializeObject(currOpr);
|
||||
answ = currOpr;
|
||||
//var encrData = SteamCrypto.EncryptString(rawData, passPhrase);
|
||||
await redisDb.StringSetAsync(currKey, currOpr, ConfigCache);
|
||||
if (answ == null)
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"OperatoreSetRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
await Task.Delay(1);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stato prod macchina
|
||||
/// </summary>
|
||||
@@ -3003,6 +2969,8 @@ namespace MP.Data.Services
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected int expDays = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
@@ -3015,6 +2983,27 @@ namespace MP.Data.Services
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache data dal valore in config
|
||||
/// </summary>
|
||||
protected TimeSpan ConfigCache
|
||||
{
|
||||
get => TimeSpan.FromDays(expDays);
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void setExpDays()
|
||||
{
|
||||
ConfigGetVal("cookieDayExpire", ref expDays);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
Reference in New Issue
Block a user