Skip to content

Commit

Permalink
Handle CancellationToken for Retry
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-csala committed Nov 18, 2024
1 parent 1401b0e commit a77284a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Polly.Core/Retry/RetryResilienceStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected internal override async ValueTask<Outcome<T>> ExecuteCore<TState>(Func
TelemetryUtil.ReportExecutionAttempt(_telemetry, context, outcome, attempt, executionTime, handle);
}

if (isLastAttempt || !handle)
if (context.CancellationToken.IsCancellationRequested || isLastAttempt || !handle)
{
return outcome;
}
Expand Down

0 comments on commit a77284a

Please sign in to comment.