Fix conf x lettura parametro redis ricerca dati H2IOB
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
"BaseAddr": "https://localhost:7295/MP/TAB3/",
|
||||
"BasePathDisegni": "\\\\iis01\\W$\\Files\\Disegni",
|
||||
"BaseUrlTab": "/MP/TAB3",
|
||||
"ImgBasePath": "https://iis01.egalware.com/MP/images/macchine/small/"
|
||||
"ImgBasePath": "https://iis01.egalware.com/MP/images/macchine/small/",
|
||||
"MpIoNS": "MoonPro:SQL2016DEV:MoonPro"
|
||||
},
|
||||
"AlarmDest": "samuele.locatelli@egalware.com, ceo@steamware.net",
|
||||
"MailKitMailSettings": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using EgwCoreLib.Utils;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.Data.Objects;
|
||||
@@ -72,6 +73,7 @@ namespace MP.Data.Services
|
||||
Log.Info(sb.ToString());
|
||||
// sistemo i parametri x redHas...
|
||||
CodModulo = _configuration.GetValue<string>("OptConf:CodModulo");
|
||||
MpIoNS = _configuration.GetValue<string>("ServerConf:MpIoNS");
|
||||
var cstringArray = ConnStr.Split(";");
|
||||
foreach (var item in cstringArray)
|
||||
{
|
||||
@@ -889,7 +891,7 @@ namespace MP.Data.Services
|
||||
sw.Start();
|
||||
IOB_data? result = new IOB_data();
|
||||
// cerco in redis...
|
||||
string currKey = redHash($"hM2IOB:{IdxMacchina}");
|
||||
string currKey = redHashMpIO($"hM2IOB:{IdxMacchina}");
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
@@ -3219,6 +3221,7 @@ namespace MP.Data.Services
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private string CodModulo = "";
|
||||
private string MpIoNS = "";
|
||||
|
||||
private string ConnStr = "";
|
||||
|
||||
@@ -3320,6 +3323,23 @@ namespace MP.Data.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
private string redHashMpIO(string keyName)
|
||||
{
|
||||
string result = keyName;
|
||||
try
|
||||
{
|
||||
result = $"{MpIoNS}:{keyName}".Replace("\\", "_");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in redHashMpIO{Environment.NewLine}{exc}");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Recupero HashSet redis come Dictionary
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user