Skip to content

Commit

Permalink
fix(suspicious): api run migrations async
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Nov 21, 2024
1 parent a955901 commit 8f5fd88
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace Basisregisters.IntegrationDb.SuspiciousCases.Api.Infrastructure
using System;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Abstractions;
using Asp.Versioning.ApiExplorer;
using Autofac;
Expand Down Expand Up @@ -164,9 +165,12 @@ public void Configure(
}
});

MigrationsHelper.Run(
_configuration.GetConnectionString("Integration"),
serviceProvider.GetService<ILoggerFactory>());
appLifetime.ApplicationStarted.Register(() =>
{
MigrationsHelper.Run(
_configuration.GetConnectionString("Integration"),
serviceProvider.GetService<ILoggerFactory>());
});

StartupHelpers.CheckDatabases(healthCheckService, DatabaseTag, loggerFactory).GetAwaiter().GetResult();
}
Expand Down

0 comments on commit 8f5fd88

Please sign in to comment.