@@ -74,11 +74,8 @@ public async ValueTask<ServerSession> GetSessionAsync(MySqlConnection connection
74
74
if ( ConnectionSettings . ConnectionReset || session . DatabaseOverride is not null )
75
75
{
76
76
if ( timeoutMilliseconds != 0 )
77
- session . SetTimeout ( Math . Max ( 1 ,
78
- timeoutMilliseconds - Utility . GetElapsedMilliseconds ( startingTimestamp ) ) ) ;
79
- reuseSession = await session
80
- . TryResetConnectionAsync ( ConnectionSettings , connection , ioBehavior , cancellationToken )
81
- . ConfigureAwait ( false ) ;
77
+ session . SetTimeout ( Math . Max ( 1 , timeoutMilliseconds - Utility . GetElapsedMilliseconds ( startingTimestamp ) ) ) ;
78
+ reuseSession = await session . TryResetConnectionAsync ( ConnectionSettings , connection , ioBehavior , cancellationToken ) . ConfigureAwait ( false ) ;
82
79
session . SetTimeout ( Constants . InfiniteTimeout ) ;
83
80
}
84
81
else
@@ -110,8 +107,7 @@ public async ValueTask<ServerSession> GetSessionAsync(MySqlConnection connection
110
107
Log . ReturningPooledSession ( m_logger , Id , session . Id , leasedSessionsCountPooled ) ;
111
108
112
109
session . LastLeasedTimestamp = Stopwatch . GetTimestamp ( ) ;
113
- MetricsReporter . RecordWaitTime ( this ,
114
- Utility . GetElapsedSeconds ( startingTimestamp , session . LastLeasedTimestamp ) ) ;
110
+ MetricsReporter . RecordWaitTime ( this , Utility . GetElapsedSeconds ( startingTimestamp , session . LastLeasedTimestamp ) ) ;
115
111
return session ;
116
112
}
117
113
}
0 commit comments