Fix gestione timer statico x update

This commit is contained in:
Samuele Locatelli
2022-12-12 14:46:50 +01:00
parent dbc8195422
commit d00f76a1dd
6 changed files with 17 additions and 8 deletions
+1 -1
View File
@@ -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!;
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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<string>? ListFlux = null;
private List<string>? ListMacchine = null;
private int numOreAnticipoSnapshot { get; set; } = 50;
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+10 -1
View File
@@ -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;