Merge pull request #6466 from elsa-workflows/blueberry-all-http-status

Simplify HttpRequestException handling in retry logic.
This commit is contained in:
raymonddenhaan 2025-03-03 16:51:56 +01:00 committed by GitHub
commit 40a12a623a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -264,7 +264,7 @@ public abstract class SendHttpRequestBase : Activity<HttpResponseMessage>
{
ShouldHandle = new PredicateBuilder<HttpResponseMessage>()
.Handle<TimeoutException>() // Specific timeout exception
.Handle<HttpRequestException>(ex => IsTransientStatusCode(ex.StatusCode)) // Network errors or transient HTTP codes
.Handle<HttpRequestException>() // Any HTTP exception
.HandleResult(response => IsTransientStatusCode(response.StatusCode)),
MaxRetryAttempts = 4,
UseJitter = false, // If enabled, adds a random value between -25% and +25% of the calculated Delay, except if BackoffType is Exponential, where a DecorrelatedJitterBackoffV2 formula is used for jitter calculation. That formula is based on Polly.Contrib.WaitAndRetry.