Skip to content

Commit e46e43e

Browse files
marcusberroji
authored andcommitted
Always close connection after reloading types in migration. (#3465)
Closes #3464 (cherry picked from commit 786b635)
1 parent db7c22e commit e46e43e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/EFCore.PG/Migrations/Internal/NpgsqlMigrator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public override void Migrate(string? targetMigration = null)
8383
{
8484
npgsqlConnection.ReloadTypes();
8585
}
86-
catch
86+
finally
8787
{
8888
_connection.Close();
8989
}
@@ -130,7 +130,7 @@ public override async Task MigrateAsync(
130130
{
131131
await npgsqlConnection.ReloadTypesAsync().ConfigureAwait(false);
132132
}
133-
catch
133+
finally
134134
{
135135
await _connection.CloseAsync().ConfigureAwait(false);
136136
}

0 commit comments

Comments
 (0)