Skip to content

Commit

Permalink
Don't validate content if retry is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
gladysheva committed Aug 26, 2024
1 parent cf0ce5d commit 9f710af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Vostok.ClusterClient.Core/Modules/RequestRetryModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public async Task<ClusterResult> ExecuteAsync(IRequestContext context, Func<IReq
if (context.Budget.HasExpired)
return result;

if (!retryPolicy.NeedToRetry(context.Request, context.Parameters, result.ReplicaResults))
return result;

if (context.Request.ContainsAlreadyUsedStream() || context.Request.ContainsAlreadyUsedContent())
{
RequestMiscExtensions.LogRequestDataIsUsed();
return result;
}

if (!retryPolicy.NeedToRetry(context.Request, context.Parameters, result.ReplicaResults))
return result;

attemptsUsed++;
var retryDelay = retryStrategy.GetRetryDelay(context, result, attemptsUsed);
if (!retryDelay.HasValue || retryDelay.Value >= context.Budget.Remaining)
Expand Down

0 comments on commit 9f710af

Please sign in to comment.