-
Notifications
You must be signed in to change notification settings - Fork 254
Milestone
Description
After a successful migration, the connection is not closed.
Change catch to finally:
efcore.pg/src/EFCore.PG/Migrations/Internal/NpgsqlMigrator.cs
Lines 83 to 91 in 3cbdba4
| _connection.Open(); | |
| try | |
| { | |
| npgsqlConnection.ReloadTypes(); | |
| } | |
| catch | |
| { | |
| _connection.Close(); | |
| } |
and
efcore.pg/src/EFCore.PG/Migrations/Internal/NpgsqlMigrator.cs
Lines 126 to 134 in 3cbdba4
| await _connection.OpenAsync(cancellationToken).ConfigureAwait(false); | |
| try | |
| { | |
| await npgsqlConnection.ReloadTypesAsync(cancellationToken).ConfigureAwait(false); | |
| } | |
| catch | |
| { | |
| await _connection.CloseAsync().ConfigureAwait(false); | |
| } |