-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1502317: Stop retry on nonrecoverable exception
- Loading branch information
1 parent
60c2f2b
commit 1f51027
Showing
3 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
using Snowflake.Data.Core; | ||
using System; | ||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Snowflake.Data.Tests.Mock | ||
{ | ||
|
||
class MockInfiniteTimeout : RestRequester, IMockRestRequester | ||
{ | ||
public MockInfiniteTimeout() : base(null) | ||
{ | ||
// Does nothing | ||
} | ||
|
||
public void setHttpClient(HttpClient httpClient) | ||
{ | ||
base._HttpClient = httpClient; | ||
} | ||
|
||
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage message, | ||
TimeSpan restTimeout, | ||
CancellationToken externalCancellationToken, | ||
string sid = "") | ||
{ | ||
message.Properties[BaseRestRequest.HTTP_REQUEST_TIMEOUT_KEY] = Timeout.InfiniteTimeSpan; | ||
return await (base.SendAsync(message, restTimeout, externalCancellationToken).ConfigureAwait(false)); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters