Skip to content

Commit d426b96

Browse files
committed
Refactor DefaultRetryPolicy and improve status code handling in RetryDelayCalculator
1 parent 72feaf8 commit d426b96

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

Contentstack.Management.Core/Runtime/Pipeline/RetryHandler/DefaultRetryPolicy.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Net;
44
using System.Net.Http;
5-
using System.Net.Http.Headers;
65
using Contentstack.Management.Core.Exceptions;
76
using Contentstack.Management.Core.Runtime.Contexts;
87

@@ -208,11 +207,6 @@ public TimeSpan GetNetworkRetryDelay(IRequestContext requestContext)
208207
requestContext.NetworkRetryCount,
209208
retryConfiguration);
210209
}
211-
212-
// Internal methods for testing
213-
internal bool CanRetryInternal(IExecutionContext executionContext) => CanRetry(executionContext);
214-
internal bool RetryForExceptionInternal(IExecutionContext executionContext, Exception exception) => RetryForException(executionContext, exception);
215-
internal bool RetryLimitExceededInternal(IExecutionContext executionContext) => RetryLimitExceeded(executionContext);
216210
}
217211
}
218212

Contentstack.Management.Core/Runtime/Pipeline/RetryHandler/RetryDelayCalculator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public bool ShouldRetryHttpStatusCode(HttpStatusCode statusCode, RetryConfigurat
111111
}
112112

113113
// Default retry condition: 429, 500, 502, 503, 504
114-
return statusCode == (HttpStatusCode)429 || // TooManyRequests
114+
return statusCode == HttpStatusCode.TooManyRequests || // TooManyRequests
115115
statusCode == HttpStatusCode.InternalServerError ||
116116
statusCode == HttpStatusCode.BadGateway ||
117117
statusCode == HttpStatusCode.ServiceUnavailable ||

Contentstack.Management.Core/contentstack.management.core.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net471;net472;</TargetFrameworks>
5-
<LangVersion>8.0</LangVersion>
65
<Title>Contentstack Management</Title>
76
<Authors>Contentstack</Authors>
87
<Copyright>Copyright © 2012-2025 Contentstack. All Rights Reserved</Copyright>

0 commit comments

Comments
 (0)