From df35dbd34d6ad15b89738f184aac28f3f10586ad 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IO.Ably.Shared/Http/AblyHttpClient.cs b/src/IO.Ably.Shared/Http/AblyHttpClient.cs index e91ab2bda..c94f36658 100644 --- a/src/IO.Ably.Shared/Http/AblyHttpClient.cs +++ b/src/IO.Ably.Shared/Http/AblyHttpClient.cs @@ -88,7 +88,7 @@ public async Task 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); @@ -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));