Added asset id counter to migrations, fixed migrations async issue

This commit is contained in:
2025-10-12 17:55:21 +02:00
parent 5ff75e162d
commit 434b0952dc
4 changed files with 34 additions and 15 deletions

View File

@@ -32,7 +32,7 @@ builder.Services.AddElmah<XmlFileErrorLog>(Options =>
});
builder.Services.AddSingleton<LdapService>();
builder.Services.AddSingleton<MigrationService>();
builder.Services.AddHostedService<MigrationService>();
builder.Services.AddHealthChecks()
.AddCheck<DatabaseHealthCheck>("DatabaseHealthCheck");
@@ -123,8 +123,5 @@ app.MapControllerRoute(
app.MapHealthChecks("/healthz")
.RequireAuthorization();
// Run migrations
using var scope = app.Services.CreateScope();
var migrationService = scope.ServiceProvider.GetRequiredService<MigrationService>();
app.Run();