@@ -44,7 +44,7 @@ public static TResult Execute<TResult>(OperationContext operationContext, IRetry
4444 }
4545 catch ( Exception ex )
4646 {
47- if ( ! ShouldRetryOperation ( operationContext , context , server , ex , totalAttempts ) )
47+ if ( ! ShouldRetryOperation ( operationContext , context , ex , totalAttempts ) )
4848 {
4949 throw originalException ?? ex ;
5050 }
@@ -76,7 +76,7 @@ public static async Task<TResult> ExecuteAsync<TResult>(OperationContext operati
7676 }
7777 catch ( Exception ex )
7878 {
79- if ( ! ShouldRetryOperation ( operationContext , context , server , ex , totalAttempts ) )
79+ if ( ! ShouldRetryOperation ( operationContext , context , ex , totalAttempts ) )
8080 {
8181 throw originalException ?? ex ;
8282 }
@@ -88,11 +88,8 @@ public static async Task<TResult> ExecuteAsync<TResult>(OperationContext operati
8888 }
8989
9090 // private static methods
91- private static bool ShouldRetryOperation ( OperationContext operationContext , RetryableReadContext context , ServerDescription server , Exception exception , int totalAttempts )
91+ private static bool ShouldRetryOperation ( OperationContext operationContext , RetryableReadContext context , Exception exception , int totalAttempts )
9292 {
93- if ( server is null )
94- return false ;
95-
9693 exception = exception is MongoAuthenticationException mongoAuthenticationException ? mongoAuthenticationException . InnerException : exception ;
9794
9895 if ( ! context . RetryRequested || context . Binding . Session . IsInTransaction )
0 commit comments