Skip to content

Commit

Permalink
Reduced timeout to 3 seconds (#4)
Browse files Browse the repository at this point in the history
* NEW! Add ListConfigs()

- Model
- Call
- Test
- Readme

* NEW! Add RecheckTorrents()

- Call
- Test
- Readme

* NEW! Add AddTorrentByUrl()

- DelugeResponse
- Call
- Test
- Constants
- Readme

* NEW! Add AddTorrentByUrl()

- TorrentExtended
- Calls
- Test
- Readme

* Reduced timeout to 3 seconds

---------

Co-authored-by: Rafael Calafell Cladera <[email protected]>
  • Loading branch information
rafacc87 and rafaelkan authored Nov 4, 2024
1 parent 6ed0941 commit d29c036
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DelugeRPCClient.Net/Core/CoreDelugeWebClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ private async Task<String> PostJson(String json)
StringContent content = new StringContent(json);
content.Headers.ContentType = new MediaTypeWithQualityHeaderValue("application/json");

var responseMessage = await HttpClient.PostAsync(Url, content);
var httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromMilliseconds(30);
var responseMessage = await httpClient.PostAsync(Url, content);
responseMessage.EnsureSuccessStatusCode();

var responseJson = await responseMessage.Content.ReadAsStringAsync();
Expand Down

0 comments on commit d29c036

Please sign in to comment.