Skip to content

Commit

Permalink
Refactored AblyHttpClient code as per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 19, 2024
1 parent 9a80c7e commit df35dbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/IO.Ably.Shared/Http/AblyHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public async Task<AblyResponse> Execute(AblyRequest request)
int currentTry = 0;
var startTime = Now();

var maxNumberOfRetries = Options.HttpMaxRetryCount; // One for the first request
var maxNumberOfRetries = Options.HttpMaxRetryCount;
var host = GetHost();

request.Headers.TryGetValue("request_id", out var requestId);
Expand Down Expand Up @@ -148,7 +148,7 @@ public async Task<AblyResponse> Execute(AblyRequest request)
throw new AblyException(new ErrorInfo(WrapWithRequestId("Error executing request. " + ex.Message), ErrorCodes.InternalError), ex);
}
}
while (currentTry <= maxNumberOfRetries);
while (currentTry <= maxNumberOfRetries); // 1 primary host and remaining fallback hosts

throw new AblyException(new ErrorInfo(WrapWithRequestId("Error executing request, exceeded max no. of retries"), ErrorCodes.InternalError));

Expand Down

0 comments on commit df35dbd

Please sign in to comment.