Skip to content

Commit

Permalink
Always close connection after reloading types in migration. (#3465)
Browse files Browse the repository at this point in the history
Closes #3464
  • Loading branch information
marcusber authored Feb 15, 2025
1 parent 3cbdba4 commit 786b635
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EFCore.PG/Migrations/Internal/NpgsqlMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public override void Migrate(string? targetMigration)
{
npgsqlConnection.ReloadTypes();
}
catch
finally
{
_connection.Close();
}
Expand Down Expand Up @@ -128,7 +128,7 @@ public override async Task MigrateAsync(string? targetMigration, CancellationTok
{
await npgsqlConnection.ReloadTypesAsync(cancellationToken).ConfigureAwait(false);
}
catch
finally
{
await _connection.CloseAsync().ConfigureAwait(false);
}
Expand Down

0 comments on commit 786b635

Please sign in to comment.