Skip to content

Commit 5014ee6

Browse files
marcusberroji
authored andcommitted
Reload types should close the newly opened connection. (#3561)
Fixes #3560 (cherry picked from commit fb96538)
1 parent 8e92287 commit 5014ee6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/EFCore.PG/Storage/Internal/NpgsqlDatabaseCreator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public override void CreateTables()
354354
{
355355
npgsqlConnection.ReloadTypes();
356356
}
357-
catch
357+
finally
358358
{
359359
npgsqlConnection.Close();
360360
}
@@ -396,7 +396,7 @@ await Dependencies.MigrationCommandExecutor.ExecuteNonQueryAsync(commands, conne
396396
{
397397
await npgsqlConnection.ReloadTypesAsync(cancellationToken).ConfigureAwait(false);
398398
}
399-
catch
399+
finally
400400
{
401401
await npgsqlConnection.CloseAsync().ConfigureAwait(false);
402402
}

0 commit comments

Comments
 (0)