JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
134 stars 105 forks source link

Configure BearerTokenConnection timeout #102

Closed ryanmaynord closed 3 years ago

ryanmaynord commented 3 years ago

This might be more of a question than an issue, but is there anyway to set the HttpClient timeout on the BearerTokenConnection object? I've been trying to play around with the object, and using the GetAuthenticatedHttpClient() for setting this property, but I am not having any luck.

Any help would be appreciated.

If this is not supported, I think this would be an extremely convenient feature to add.

maartenba commented 3 years ago

Is there any reason for setting a timeout? If you have some sort of pseudo-code sample of what you want to achieve that may be of help too.

ryanmaynord commented 3 years ago

Our YouTrack server experiences heavy load during certain parts of the day, and due to this, some of the reports we pull using YouTrack queries can take longer than expected. Sometimes this wait time exceeds the default timeout (100 seconds) of the HttpClient object, which results in these reports failing.

Right now I'm emulating the backend code of YouTrackSharp to obtain what I need for these reports to run successfully, but I do think having this as a feature would be beneficial to not only myself, but other people as well.

maartenba commented 3 years ago

There you go, the BearerTokenConnection now has a property to configure Timeout.

ryanmaynord commented 3 years ago

@maartenba Thanks so much!