Skip to content

Commit

Permalink
RaynaldM code review
Browse files Browse the repository at this point in the history
  • Loading branch information
raman-m committed Aug 14, 2023
1 parent d8f996d commit 59df4f4
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
try
{
var policies = _qoSProvider.CircuitBreaker.Policies;
if (policies.Any())
if (!policies.Any())
{
IAsyncPolicy policy = policies.Length > 1
? Policy.WrapAsync(policies)
: policies[0];

return await policy.ExecuteAsync(() => base.SendAsync(request, cancellationToken));
return await base.SendAsync(request, cancellationToken);
}

return await base.SendAsync(request, cancellationToken);
IAsyncPolicy policy = policies.Length > 1
? Policy.WrapAsync(policies)
: policies[0];

return await policy.ExecuteAsync(() => base.SendAsync(request, cancellationToken));
}
catch (BrokenCircuitException ex)
{
Expand Down

0 comments on commit 59df4f4

Please sign in to comment.