Skip to content

Successful migration doesn't close connection #3464

@marcusber

Description

@marcusber

After a successful migration, the connection is not closed.

Change catch to finally:

_connection.Open();
try
{
npgsqlConnection.ReloadTypes();
}
catch
{
_connection.Close();
}

and
await _connection.OpenAsync(cancellationToken).ConfigureAwait(false);
try
{
await npgsqlConnection.ReloadTypesAsync(cancellationToken).ConfigureAwait(false);
}
catch
{
await _connection.CloseAsync().ConfigureAwait(false);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions