diff --git a/MP.SPEC/Components/CmpFooter.razor.cs b/MP.SPEC/Components/CmpFooter.razor.cs index 1633f803..f58b1fe0 100644 --- a/MP.SPEC/Components/CmpFooter.razor.cs +++ b/MP.SPEC/Components/CmpFooter.razor.cs @@ -47,7 +47,7 @@ namespace MP.SPEC.Components #region Private Fields - private static System.Timers.Timer aTimer = null!; + private System.Timers.Timer aTimer = null!; private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); private Version version = null!; diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index e296dcb2..097d6b94 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -51,6 +51,7 @@ namespace MP.SPEC.Components { aTimer.Elapsed -= ElapsedTimer; aTimer.Stop(); + aTimer.Close(); aTimer.Dispose(); currRecord = null; SearchRecords = null; @@ -97,7 +98,7 @@ namespace MP.SPEC.Components dataTo = (DateTime)SelDtMax; } - SearchRecords = await MDService.FluxLogGetLastFilt(dataTo, dataFrom, SelMacchina, SelFlux, MaxRecord, RefreshPeriod / 1000); + SearchRecords = await MDService.FluxLogGetLastFilt(dataTo, dataFrom, SelMacchina, SelFlux, MaxRecord, RefreshPeriod / 1000 * 1.1); totalCount = SearchRecords.Count; ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); @@ -179,7 +180,6 @@ namespace MP.SPEC.Components SelDtMax = selRec.dtEvento; // imposto pag 1 filtro SelFilter.CurrPage = 1; - //selDtMin = RoundDatetime(5).AddHours(-25); await reloadData(false); await RecordSel.InvokeAsync(selRec); await PagerResetReq.InvokeAsync(true); @@ -195,7 +195,7 @@ namespace MP.SPEC.Components #region Private Fields - private static System.Timers.Timer aTimer = null!; + private System.Timers.Timer aTimer = null!; private int _totalCount = 0; diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index 7978bb82..08968b94 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -267,7 +267,7 @@ namespace MP.SPEC.Components #region Private Fields - private static System.Timers.Timer aTimer = new System.Timers.Timer(); + private System.Timers.Timer aTimer = new System.Timers.Timer(); private List? ListFlux = null; private List? ListMacchine = null; private int numOreAnticipoSnapshot { get; set; } = 50; diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 4fbfe663..771ebbb4 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -619,7 +619,7 @@ namespace MP.SPEC.Data } if (canCacheParametri != "false") { - redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisCacheSec / 2)); + redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisCacheSec)); } } if (result == null) diff --git a/MP.SPEC/Data/SelectFluxParams.cs b/MP.SPEC/Data/SelectFluxParams.cs index 10c7ebee..e20aa1b4 100644 --- a/MP.SPEC/Data/SelectFluxParams.cs +++ b/MP.SPEC/Data/SelectFluxParams.cs @@ -26,7 +26,7 @@ public bool LiveUpdate { get; set; } = true; public int MaxRecord { get; set; } = 100; public int NumRec { get; set; } = 10; - public int TempoAgg { get; set; } = 10000; + public int TempoAgg { get; set; } = 2000; public int TotCount { get; set; } = 0; #endregion Public Properties diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs index fb4e977c..e537924d 100644 --- a/MP.SPEC/Pages/PARAMS.razor.cs +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -4,8 +4,17 @@ using MP.SPEC.Data; namespace MP.SPEC.Pages { - public partial class PARAMS + public partial class PARAMS : IDisposable { + #region Public Methods + + public void Dispose() + { + GC.Collect(); + } + + #endregion Public Methods + #region Protected Fields protected int CurrCounter = 0;