motornet icon indicating copy to clipboard operation
motornet copied to clipboard

HttpOptions.TimeoutInSeconds not working for values higher than 100s

Open FlorianHockmann opened this issue 2 years ago • 0 comments

If I'm not mistaken, then the HttpOptions.TimeoutInSeconds are not working as expected right now because they are only used to create a policy which will let the HTTP request timeout after the specified timeout. The HttpClient used for that request however also has a timeout which defaults to 100s. If the configured timeout is higher than that, then the request will timeout after 100 seconds and the configured timeout used in the policy will never be used.

I am not sure why we use this policy at all if the HttpClient already has a timeout. We should probably remove the timeout policy completely and instead just configure the timeout used for HttpClient.

We could also use this opportunity to refactor TimeoutInSeconds into a TimeSpan Timeout which would be more consistent with other such settings in .NET.

FlorianHockmann avatar Jan 03 '23 08:01 FlorianHockmann