Skip to content

Commit e5c9b5b

Browse files
authored
Update ApplicationDbInitializer.cs (#519)
1 parent ceccd54 commit e5c9b5b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Infrastructure/Persistence/Initialization/ApplicationDbInitializer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ public async Task InitializeAsync(CancellationToken cancellationToken)
2424
{
2525
if (_dbContext.Database.GetMigrations().Any())
2626
{
27-
if (_dbContext.Database.GetPendingMigrations().Any())
27+
if ((await _dbContext.Database.GetPendingMigrationsAsync(cancellationToken)).Any())
2828
{
2929
_logger.LogInformation("Applying Migrations for '{tenantId}' tenant.", _currentTenant.Id);
3030
await _dbContext.Database.MigrateAsync(cancellationToken);
3131
}
3232

33-
if (_dbContext.Database.CanConnect())
33+
if (await _dbContext.Database.CanConnectAsync(cancellationToken))
3434
{
3535
_logger.LogInformation("Connection to {tenantId}'s Database Succeeded.", _currentTenant.Id);
3636

3737
await _dbSeeder.SeedDatabaseAsync(_dbContext, cancellationToken);
3838
}
3939
}
4040
}
41-
}
41+
}

0 commit comments

Comments
 (0)