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 4d06b27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/IO.Ably.Shared/Http/AblyHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ public async Task<AblyResponse> Execute(AblyRequest request)
{
var fallbackHosts = GetFallbackHosts();

int currentTry = 0;
int currentTry = 0;

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net6.0)

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net6.0)

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net6.0)

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net6.0)

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net7.0)

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net7.0)

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net6.0)

Check failure on line 88 in src/IO.Ably.Shared/Http/AblyHttpClient.cs

View workflow job for this annotation

GitHub Actions / check (net6.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 4d06b27

Please sign in to comment.