Fix commento xu stop dati storici

This commit is contained in:
Samuele Locatelli
2026-04-07 12:34:41 +02:00
parent 45acc78dc9
commit 05b771badb
+10 -6
View File
@@ -61,13 +61,13 @@ namespace MP.IOC.Services
{
try
{
var deleteConfirmed = _config.GetValue<bool>("RouteMan:RecoverHistoricalMetrics", false);
//var deleteConfirmed = _config.GetValue<bool>("RouteMan:RecoverHistoricalMetrics", false);
if (!deleteConfirmed)
{
Log.Debug("Historical metrics recovery disabled, skipping");
return;
}
//if (!deleteConfirmed)
//{
// Log.Debug("Historical metrics recovery disabled, skipping");
// return;
//}
Log.Info("Starting historical metrics recovery from Redis...");
@@ -133,6 +133,8 @@ namespace MP.IOC.Services
if (recordsToInsert.Count > 0)
{
await using var scope = _scopeFactory.CreateAsyncScope();
var _aggrService = scope.ServiceProvider.GetRequiredService<IStatsAggrService>();
await _aggrService.UpsertManyAsync(recordsToInsert, false);
Log.Info("[HISTORICAL] Recovered {count} hourly records for method {method}", recordsToInsert.Count, method);
@@ -189,6 +191,8 @@ namespace MP.IOC.Services
if (recordsToInsert.Count > 0)
{
await using var scope = _scopeFactory.CreateAsyncScope();
var _detailService = scope.ServiceProvider.GetRequiredService<IStatsDetailService>();
await _detailService.UpsertManyAsync(recordsToInsert, false);
Log.Info("[HISTORICAL] Recovered {count} daily records for method {method}", recordsToInsert.Count, method);