feat(fundamentals): add KeyedLockPool for concurrent scraping synchronization and update MQTT RPC handlers

This commit is contained in:
2026-08-24 21:35:43 +02:00
parent 8112598602
commit 600ccf299e
6 changed files with 136 additions and 69 deletions
+4 -3
View File
@@ -18,8 +18,7 @@ var builder = Host.CreateApplicationBuilder(args);
// Register DB Context & ISettingsDbContext
builder.Services.AddDbContext<FundamentalsDbContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))
.ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)));
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
builder.Services.AddScoped<ISettingsDbContext>(sp => sp.GetRequiredService<FundamentalsDbContext>());
// Register HTTP Clients
@@ -57,8 +56,10 @@ using (var scope = host.Services.CreateScope())
try
{
var context = scope.ServiceProvider.GetRequiredService<FundamentalsDbContext>();
await context.Database.MigrateAsync();
var connStr = builder.Configuration.GetConnectionString("DefaultConnection") ?? "";
await context.MigrateWithBootstrapAsync(connStr);
Console.WriteLine("Database migrations successfully executed for FinlyticFundamentals.");
}
catch (Exception ex)
{