Open rafacc87 opened 2 weeks ago
To be honest, I couldn't find in the code where this timeout is defined. Could you tell me where this is located?
Here's how to fix it Here's how to fix it in the PostJson function:
var httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromMilliseconds(30);
var responseMessage = await httpClient.PostAsync(Url, content);
Hello @rafacc87,
I have merged your MR and added an optional DelugeClientConfig parameter to let the user configure the timeout (running tests on my laptop with a dockerised deluge will fail with 3 seconds)
DelugeClientConfig config = new DelugeClientConfig()
{
IgnoreSslErrors = true,
Timeout = new TimeSpan(0, 0, 30)
};
DelugeClient client = new DelugeClient(url: Constants.DelugeUrl, password: Constants.DelugePassword, config);
the third parameters (config) is optional and will take the default value of 3 secondes for timeout.
let me know if it fit your need
Why did you put 100 ms to wait for a call? Don't you think that 30 ms would be enough? It's just that if you try to add the same torrent twice instead of answering it times out and waiting 100 ms seems too much to me.