diff --git a/MP.IOC/Controllers/IOBController.cs b/MP.IOC/Controllers/IOBController.cs index 7c491fe7..e43f2633 100644 --- a/MP.IOC/Controllers/IOBController.cs +++ b/MP.IOC/Controllers/IOBController.cs @@ -810,20 +810,19 @@ namespace MP.IOC.Controllers // Multi: gestione carattere "|" trasformato in "#" id = id.Replace("|", "#"); - string answ = ""; + Dictionary valori = new(); try { await DService.ScriviKeepAliveAsync(id, DateTime.Now); // leggo da REDIS eventuale elenco task x macchina... - Dictionary valori = await DService.GetTask2ExeMacchinaAsync(id); - answ = JsonConvert.SerializeObject(valori); + valori = await DService.GetTask2ExeMacchinaAsync(id); } catch (Exception exc) { Log.Error($"Errore in GetTask2Exe{Environment.NewLine}{exc}"); return StatusCode(StatusCodes.Status500InternalServerError, "NO"); } - return Ok(answ); + return Ok(valori); } /// diff --git a/MP.IOC/Data/MpDataService.cs b/MP.IOC/Data/MpDataService.cs index cd6126f5..58bfa36c 100644 --- a/MP.IOC/Data/MpDataService.cs +++ b/MP.IOC/Data/MpDataService.cs @@ -1682,19 +1682,8 @@ namespace MP.IOC.Data /// public async Task> GetTask2ExeMacchinaAsync(string idxMacchina) { - // hard coded dimensione vettore DatiMacchine - Dictionary answ = new Dictionary(); - // ORA recupero da memoria redis... - try - { - var currHash = Utils.RedKeyTask2ExeMacc(idxMacchina, MpIoNS); - answ = await RedisGetHashDictAsync(currHash); - } - catch (Exception exc) - { - Log.Info(string.Format("Errore in GetTask2ExeMacchinaAsync | idxMacchina {2}:{0}{1}", Environment.NewLine, exc, idxMacchina)); - } - return answ; + var currHash = Utils.RedKeyTask2ExeMacc(idxMacchina, MpIoNS); + return await RedisGetHashDictAsync(currHash); } /// @@ -3560,17 +3549,7 @@ namespace MP.IOC.Data public async Task RedisKeyPresentAsync(RedisKey key) { - bool result = false; - try - { - result = await redisDb.KeyExistsAsync(key); - } - catch (Exception arg) - { - Log.Error($"Errore in redKeyPresent per la currKey {key}:{Environment.NewLine}{arg}"); - } - - return result; + return await redisDb.KeyExistsAsync(key); } public bool RedisKeyPresentSz(string key) @@ -4129,29 +4108,16 @@ namespace MP.IOC.Data { string nomeVar = string.Format("KeepAlive:{0}", IdxMacchina); // cerco se ho keep alive in redis, - bool keyPresent = false; DateTime adesso = DateTime.Now; var currKey = Utils.RedKeyHash(nomeVar); - try - { - keyPresent = await RedisKeyPresentAsync(currKey); - } - catch - { } + bool keyPresent = await RedisKeyPresentAsync(currKey); // se NON presente salvo in REDIS con TTL 10 sec e sul DB... if (!keyPresent) { - await redisDb.StringSetAsync(currKey, adesso.ToString("s"), TimeSpan.FromSeconds(10)); - try - { - Log.Trace($"Scrittura keep alive! IdxMacchina: {IdxMacchina}"); - // effettuo scrittura sul DB - await IocDbController.KeepAliveUpsertAsync(IdxMacchina, DateTime.Now, oraMacchina); - } - catch (Exception exc) - { - Log.Error($"Errore in scrittura keep alive!{Environment.NewLine}oraMacchina: {oraMacchina} - IdxMacchina: {IdxMacchina}{Environment.NewLine}{exc}"); - } + await redisDb.StringSetAsync(currKey, adesso.ToString("s"), TimeSpan.FromSeconds(20)); + Log.Trace($"Scrittura keep alive! IdxMacchina: {IdxMacchina}"); + // effettuo scrittura sul DB + await IocDbController.KeepAliveUpsertAsync(IdxMacchina, DateTime.Now, oraMacchina); } } diff --git a/MP.IOC/MP.IOC.csproj b/MP.IOC/MP.IOC.csproj index 7b98492d..0f6d257a 100644 --- a/MP.IOC/MP.IOC.csproj +++ b/MP.IOC/MP.IOC.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 6.16.2604.1708 + 6.16.2604.1709 diff --git a/MP.IOC/Resources/ChangeLog.html b/MP.IOC/Resources/ChangeLog.html index a0b1750d..32944119 100644 --- a/MP.IOC/Resources/ChangeLog.html +++ b/MP.IOC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MP-IOC -

Versione: 6.16.2604.1708

+

Versione: 6.16.2604.1709


Note di rilascio:
  • diff --git a/MP.IOC/Resources/VersNum.txt b/MP.IOC/Resources/VersNum.txt index 23fac1d1..974a30ac 100644 --- a/MP.IOC/Resources/VersNum.txt +++ b/MP.IOC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2604.1708 +6.16.2604.1709 diff --git a/MP.IOC/Resources/manifest.xml b/MP.IOC/Resources/manifest.xml index 588db0e5..7516b3f9 100644 --- a/MP.IOC/Resources/manifest.xml +++ b/MP.IOC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2604.1708 + 6.16.2604.1709 https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html false diff --git a/MP.IOC/appsettings.Production.json b/MP.IOC/appsettings.Production.json index ad5fa751..703dacca 100644 --- a/MP.IOC/appsettings.Production.json +++ b/MP.IOC/appsettings.Production.json @@ -15,10 +15,10 @@ ], "Clusters": { "cluster-old": { - "Destinations": { "old1": { "Address": "https://iis01.egalware.com/MP/IO/IOB/" } } + "Destinations": { "old1": { "Address": "https://maposrv.egalware.com/MP/IO/IOB/" } } }, "cluster-new": { - "Destinations": { "new1": { "Address": "https://iis01.egalware.com/MP/IOC/api/IOB/" } } + "Destinations": { "new1": { "Address": "https://maposrv.egalware.com/MP/IOC/api/IOB/" } } } } },