modifiche minori prima di ottimizzare IOC di nuovo
This commit is contained in:
@@ -79,9 +79,7 @@ namespace MP.Data.Services.IOC
|
||||
else
|
||||
{
|
||||
result = await GetCurrOdlByProdAsync(idxMacchina);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
_redisDb.StringSet(currKey, rawData, GetRandTOut(redisLongTimeCache * 2));
|
||||
_redisDb.StringSet(currKey, result, GetRandTOut(redisLongTimeCache * 2));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -200,8 +198,7 @@ namespace MP.Data.Services.IOC
|
||||
public async Task<int> PzCounterTcAsync(string idxMacchina)
|
||||
{
|
||||
int answ = -1;
|
||||
DateTime dataRif = DateTime.Now;
|
||||
var datiProd = await StatoProdMacchinaAsync(idxMacchina, dataRif);
|
||||
var datiProd = await StatoProdMacchinaAsync(idxMacchina, DateTime.Now);
|
||||
if (datiProd != null)
|
||||
{
|
||||
answ = datiProd.PzTotODL;
|
||||
@@ -1024,6 +1021,7 @@ namespace MP.Data.Services.IOC
|
||||
private async Task<StatoProdModel> StatoProdMacchinaAsync(string idxMacchina, DateTime dtReq, bool forceDb = false)
|
||||
{
|
||||
string cacheKey = $"IOC_StatoProd_{idxMacchina}";
|
||||
var stdTTL = TimeSpan.FromSeconds(30);
|
||||
return await GetOrFetchAsync(cacheKey, async () =>
|
||||
{
|
||||
StatoProdModel? result = new StatoProdModel();
|
||||
@@ -1039,14 +1037,14 @@ namespace MP.Data.Services.IOC
|
||||
result = await _repo.StatoProdMacchinaAsync(idxMacchina, dtReq);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await _redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromSeconds(30));
|
||||
await _redisDb.StringSetAsync(currKey, rawData, stdTTL);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new StatoProdModel();
|
||||
}
|
||||
return result;
|
||||
}, TimeSpan.FromSeconds(3));
|
||||
}, stdTTL);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -485,7 +485,6 @@ namespace MP.IOC.Controllers
|
||||
{
|
||||
Log.Error(exc, "Errore GetCurrODL | macchina {MachineId}", id);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, "NO");
|
||||
//return StatusCode(StatusCodes.Status500InternalServerError, "Errore interno | GetCurrODL");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -796,9 +796,7 @@ namespace MP.IOC.Data
|
||||
else
|
||||
{
|
||||
result = await GetCurrOdlByProdAsync(idxMacchina);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
redisDb.StringSet(currKey, result, getRandTOut(redisLongTimeCache * 2));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>8.16.2606.919</Version>
|
||||
<Version>8.16.2606.1014</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MP-IOC </i>
|
||||
<h4>Versione: 8.16.2606.919</h4>
|
||||
<h4>Versione: 8.16.2606.1014</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.919
|
||||
8.16.2606.1014
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.919</version>
|
||||
<version>8.16.2606.1014</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user