Migrazione controller stats e CalcRuid (complessa...)

This commit is contained in:
Samuele Locatelli
2026-03-21 11:33:49 +01:00
parent 4aa21de3b7
commit 4916dd42ff
20 changed files with 146 additions and 192 deletions
+2 -14
View File
@@ -139,8 +139,6 @@ builder.Services.AddSingleton<IConnectionMultiplexer>(redisConn);
builder.Services.AddSingleton<IRedisService, RedisService>();
builder.Services.AddSingleton<RedisSubscriptionManager>();
var connectionString = builder.Configuration.GetConnectionString("Lux.All") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
// DataLayerContext (manca!)
builder.Services.AddDbContextFactory<DataLayerContext>(options =>
@@ -170,18 +168,8 @@ builder.Services.AddScoped<ExternalMessageProcessor>();
builder.Services.AddHostedService<RedisSubscriberService>();
// init servizio gestone ReqIndex
string cleanupDayTTL = configuration.GetValue<string>("ServerConf:CleanupDayTTL") ?? "360";
string rBaseKey = configuration.GetValue<string>("ServerConf:RedisBaseKey") ?? "Lux";
int dayTTL = 360;
int archTTL = 2;
int.TryParse(cleanupDayTTL, out dayTTL);
builder.Services.AddSingleton(new CalcRuidService(
configuration,
redisConn,
redisBaseKey: rBaseKey,
retention: TimeSpan.FromDays(dayTTL),
archivePeriod: TimeSpan.FromDays(archTTL)
));
builder.Services.AddScoped<CalcRuidService>();
//builder.Services.AddSingleton(new CalcRuidService(configuration, redisConn));
builder.Services.AddHostedService<StatsCollectService>();