Update con close iniziale calcoli completati

This commit is contained in:
Samuele Locatelli
2025-12-17 08:23:27 +01:00
parent b390165a96
commit 23e7055eca
3 changed files with 6 additions and 2 deletions
@@ -224,7 +224,7 @@ namespace EgwCoreLib.Lux.Data.Services
// Cancello hash delle statistiche aggregate
tasks.Add(batch.KeyDeleteAsync(Key(aggKeyStr)));
// Rimuovo dallindice
tasks.Add(batch.SetRemoveAsync(Key("stats:agg:index"), (RedisValue)$"{aggKeyStr}"));
tasks.Add(batch.SetRemoveAsync(Key("stats:agg:index"), (RedisValue)$"{hourStr}"));
// Cancello hash delle richieste per la stessa ora
tasks.Add(batch.KeyDeleteAsync(Key(reqKeyStr)));
@@ -21,6 +21,7 @@ namespace EgwCoreLib.Lux.Data.Services
try
{
reqPeriodMinute = _config.GetValue<int>("ServerConf:CleanupPeriodMinutes");
clearProcessed = _config.GetValue<bool>("ServerConf:CleanupProcessed");
}
catch
{
@@ -31,13 +32,15 @@ namespace EgwCoreLib.Lux.Data.Services
#endregion Public Constructors
private bool clearProcessed = false;
#region Protected Methods
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
await _calcRuidService.ExportStatsToDbAsync(false);
await _calcRuidService.ExportStatsToDbAsync(clearProcessed);
// attesa tra le esecuzioni
await Task.Delay(TimeSpan.FromMinutes(reqPeriodMinute), stoppingToken);
+1
View File
@@ -74,6 +74,7 @@
"FileSharePath": "\\\\stor01\\TEAM DRIVES\\40_FileUpload\\LuxUploads",
"RedisBaseKey": "Lux",
"CleanupPeriodMinutes": 30,
"CleanupProcessed": true,
"CleanupDayTTL": 180
}
}