feat(fundamentals): add KeyedLockPool for concurrent scraping synchronization and update MQTT RPC handlers
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user