Skip to content

Commit c6b1954

Browse files
committed
Revert PR 9 changes
1 parent e96e5df commit c6b1954

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

Example Projects/dotNetCoreExample/Examples/Basic/BasicSendWithRetry.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public SendResponse RunExample()
1414
var client = new SocketLabsClient(ExampleConfig.ServerId, ExampleConfig.ApiKey, proxy)
1515
{
1616
EndpointUrl = ExampleConfig.TargetApi,
17-
RequestTimeout = 120,
1817
NumberOfRetries = 3
1918
};
2019

src/SocketLabs/InjectionApi/Core/RetryHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public async Task<HttpResponseMessage> SendAsync(StringContent content, Cancella
5353
{
5454
var response = await HttpClient.PostAsync(EndpointUrl, content, cancellationToken)
5555
.ConfigureAwait(false);
56-
56+
5757
if (ErrorStatusCodes.Contains(response.StatusCode))
5858
throw new HttpRequestException(
5959
$"HttpStatusCode: '{response.StatusCode}'. Response contains server error.");

src/SocketLabs/InjectionApi/SocketLabsClient.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,7 @@ public class SocketLabsClient : ISocketLabsClient, IDisposable
4343
/// The SocketLabs Injection API endpoint Url
4444
/// </summary>
4545
public string EndpointUrl { get; set; } = "https://inject.socketlabs.com/api/v1/email";
46-
47-
/// <summary>
48-
/// A timeout period for the Injection API request (in Seconds). Default: 120s
49-
/// </summary>
50-
public int RequestTimeout { get; set; } = 120;
51-
46+
5247
/// <summary>
5348
/// RetrySettings object to define retry setting for the Injection API request.
5449
/// </summary>
@@ -237,9 +232,7 @@ public async Task<SendResponse> SendAsync(IBasicMessage message, CancellationTok
237232
var factory = new InjectionRequestFactory(_serverId, _apiKey);
238233
var injectionRequest = factory.GenerateRequest(message);
239234
var json = injectionRequest.GetAsJson();
240-
241-
_httpClient.Timeout = TimeSpan.FromSeconds(RequestTimeout);
242-
235+
243236
var retryHandler = new RetryHandler(_httpClient, EndpointUrl, new RetrySettings(NumberOfRetries));
244237
var httpResponse = await retryHandler.SendAsync(json, cancellationToken);
245238

@@ -292,9 +285,7 @@ public async Task<SendResponse> SendAsync(IBulkMessage message, CancellationToke
292285
var factory = new InjectionRequestFactory(_serverId, _apiKey);
293286
var injectionRequest = factory.GenerateRequest(message);
294287
var json = injectionRequest.GetAsJson();
295-
296-
_httpClient.Timeout = TimeSpan.FromSeconds(RequestTimeout);
297-
288+
298289
var retryHandler = new RetryHandler(_httpClient, EndpointUrl, new RetrySettings(NumberOfRetries));
299290
var httpResponse = await retryHandler.SendAsync(json, cancellationToken);
300291

0 commit comments

Comments
 (0)