Skip to content

Commit

Permalink
fix: Allow logger to be null for a retrying ApiCall
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Apr 25, 2022
1 parent 385b63f commit f7e7fdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Google.Api.Gax.Grpc/ApiCallRetryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal static Func<TRequest, CallSettings, Task<TResponse>> WithRetry<TRequest
}
catch (Exception e) when (attempt.ShouldRetry(e))
{
logger.LogDebug("Backing off before retry of method {method}", methodName);
logger?.LogDebug("Backing off before retry of method {method}", methodName);
await attempt.BackoffAsync(callSettings.CancellationToken.GetValueOrDefault()).ConfigureAwait(false);
}
}
Expand Down Expand Up @@ -72,7 +72,7 @@ internal static Func<TRequest, CallSettings, TResponse> WithRetry<TRequest, TRes
}
catch (Exception e) when (attempt.ShouldRetry(e))
{
logger.LogDebug("Backing off before retry of method {method}", methodName);
logger?.LogDebug("Backing off before retry of method {method}", methodName);
attempt.Backoff(callSettings.CancellationToken.GetValueOrDefault());
}
}
Expand Down

0 comments on commit f7e7fdf

Please sign in to comment.