Skip to content

Commit 6d4c1c0

Browse files
[FSSDK-11150] review update
1 parent e4c006d commit 6d4c1c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

OptimizelySDK/Cmab/CmabConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ internal static class CmabConstants
2727

2828
public const string ErrorFetchFailedFmt = "CMAB decision fetch failed with status: {0}";
2929
public const string ErrorInvalidResponse = "Invalid CMAB fetch response";
30+
public const string ExhaustRetryMessage = "Exhausted all retries for CMAB request";
3031
}
3132
}

OptimizelySDK/Cmab/DefaultCmabClient.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ private async Task<string> DoFetchOnceAsync(string url, CmabRequest request, Tim
116116
{
117117
using (var cts = new CancellationTokenSource(timeout))
118118
{
119-
120119
try
121120
{
122121
var httpRequest = new HttpRequestMessage
@@ -179,8 +178,8 @@ private async Task<string> DoFetchWithRetryAsync(string url, CmabRequest request
179178
{
180179
if (attempt >= _retryConfig.MaxRetries)
181180
{
182-
_logger.Log(LogLevel.ERROR, string.Format(CmabConstants.ErrorFetchFailedFmt, "Exhausted all retries for CMAB request."));
183-
throw new CmabFetchException(string.Format(CmabConstants.ErrorFetchFailedFmt, "Exhausted all retries for CMAB request."));
181+
_logger.Log(LogLevel.ERROR, string.Format(CmabConstants.ErrorFetchFailedFmt, CmabConstants.ExhaustRetryMessage));
182+
throw new CmabFetchException(string.Format(CmabConstants.ErrorFetchFailedFmt, CmabConstants.ExhaustRetryMessage));
184183
}
185184

186185
_logger.Log(LogLevel.INFO, $"Retrying CMAB request (attempt: {attempt + 1}) after {backoff.TotalSeconds} seconds...");

0 commit comments

Comments
 (0)