Skip to content

Commit 181209c

Browse files
committed
Allow OpenAsync to be canceled earlier.
1 parent 5dc9981 commit 181209c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/MySqlConnector/MySqlConnection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ private async ValueTask<bool> PingAsync(IOBehavior ioBehavior, CancellationToken
373373
internal async Task OpenAsync(IOBehavior? ioBehavior, CancellationToken cancellationToken)
374374
{
375375
VerifyNotDisposed();
376+
cancellationToken.ThrowIfCancellationRequested();
376377
if (State != ConnectionState.Closed)
377378
throw new InvalidOperationException("Cannot Open when State is {0}.".FormatInvariant(State));
378379

0 commit comments

Comments
 (0)