From d45deb6f00d6de2da5ebb241a56748d9b9859257 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 12 Dec 2022 12:06:38 +0100 Subject: [PATCH] fix tempo aggiornamento + cache x parametri opzionali --- MP.SPEC/Components/ParamsFilter.razor.cs | 8 ++++++++ MP.SPEC/Data/MpDataService.cs | 6 +++++- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index a3bdab92..7978bb82 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -167,9 +167,17 @@ namespace MP.SPEC.Components { get => selMacchina != "*" || selFlux != "*"; } + protected int refreshRate = 2; protected override async Task OnInitializedAsync() { SelFilter = new SelectFluxParams(); + await MDService.ConfigResetCache(); + var result = await MDService.tryGetConfig("SPEC_ParamTempoAgg"); + if (result != null) + { + refreshRate = int.Parse(result); + } + selTempoAgg = refreshRate; setDtSnap(); DateTime dtStart = SelFilter.dtMin != null ? (DateTime)SelFilter.dtMin : DateTime.Now.AddMonths(-1); DateTime dtEnd = SelFilter.dtMax != null ? (DateTime)SelFilter.dtMax : DateTime.Today.AddDays(1); diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 2018b81a..f8bf8e65 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -613,7 +613,11 @@ namespace MP.SPEC.Data result = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, DtMin, IdxMacchina, CodFlux, MaxRec)); // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); - redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisCacheSec / 2)); + var canCache = await tryGetConfig("SPEC_ParametriEnableReidsCache"); + if (canCache != "false") + { + redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisCacheSec / 2)); + } } if (result == null) { diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 4d48a652..e35ea786 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2212.919 + 6.16.2212.1211 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 5986881d..58bba000 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2212.919

+

Versione: 6.16.2212.1211


Note di rilascio: