Skip to content

Commit dc12740

Browse files
committed
Remove unused parameter.
Signed-off-by: Bradley Grainger <[email protected]>
1 parent c9abddc commit dc12740

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/MySqlConnector/Core/ConnectionPool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public async ValueTask<ServerSession> GetSessionAsync(MySqlConnection connection
6262
else
6363
{
6464
if (ConnectionSettings.ConnectionReset || session.DatabaseOverride is not null)
65-
reuseSession = await session.TryResetConnectionAsync(ConnectionSettings, connection, false, ioBehavior, cancellationToken).ConfigureAwait(false);
65+
reuseSession = await session.TryResetConnectionAsync(ConnectionSettings, connection, ioBehavior, cancellationToken).ConfigureAwait(false);
6666
else
6767
reuseSession = true;
6868
}

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,10 @@ public async Task DisposeAsync(IOBehavior ioBehavior, CancellationToken cancella
555555
return statusInfo;
556556
}
557557

558-
public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConnection connection, bool returnToPool, IOBehavior ioBehavior, CancellationToken cancellationToken)
558+
public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConnection connection, IOBehavior ioBehavior, CancellationToken cancellationToken)
559559
{
560560
VerifyState(State.Connected);
561561

562-
var success = false;
563562
try
564563
{
565564
// clear all prepared statements; resetting the connection will clear them on the server
@@ -606,7 +605,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
606605
payload = await ReceiveReplyAsync(ioBehavior, cancellationToken).ConfigureAwait(false);
607606
OkPayload.Create(payload.Span, SupportsDeprecateEof, SupportsSessionTrack);
608607

609-
success = true;
608+
return true;
610609
}
611610
catch (IOException ex)
612611
{
@@ -625,12 +624,7 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, MySqlConn
625624
Log.Trace(ex, "Session{0} ignoring SocketException in TryResetConnectionAsync", m_logArguments);
626625
}
627626

628-
if (returnToPool && Pool is not null)
629-
{
630-
await Pool.ReturnAsync(ioBehavior, this).ConfigureAwait(false);
631-
}
632-
633-
return success;
627+
return false;
634628
}
635629

636630
private async Task<PayloadData> SwitchAuthenticationAsync(ConnectionSettings cs, string password, PayloadData payload, IOBehavior ioBehavior, CancellationToken cancellationToken)

0 commit comments

Comments
 (0)