From 4d06b27afa3b7d8af88467b676ba6a09e9362851 Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Fri, 19 Apr 2024 19:59:01 +0530 Subject: [PATCH] Refactored AblyHttpClient code as per review comments --- src/IO.Ably.Shared/Http/AblyHttpClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/IO.Ably.Shared/Http/AblyHttpClient.cs b/src/IO.Ably.Shared/Http/AblyHttpClient.cs index e91ab2bda..6eb87d323 100644 --- a/src/IO.Ably.Shared/Http/AblyHttpClient.cs +++ b/src/IO.Ably.Shared/Http/AblyHttpClient.cs @@ -85,10 +85,10 @@ public async Task Execute(AblyRequest request) { var fallbackHosts = GetFallbackHosts(); - int currentTry = 0; + 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); @@ -148,7 +148,7 @@ public async Task 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));