sdk_csharp icon indicating copy to clipboard operation
sdk_csharp copied to clipboard

Added RetryHandler. (bunq/sdk_csharp#80)

Open nduijvelshoff opened this issue 7 years ago • 5 comments
trafficstars

  • Closes bunq/sdk_csharp#80
    • [x] Tested

nduijvelshoff avatar Jun 22 '18 11:06 nduijvelshoff

@OGKevin I don't see why my commit message is failed, the regex is a full match. image

nduijvelshoff avatar Jun 22 '18 11:06 nduijvelshoff

Yea the regex failure seems magic to me as well. But to my eyes it loos good so we will ignore it 😉

OGKevin avatar Jun 25 '18 07:06 OGKevin

@nduijvelshoff are you going to finish this ?

OGKevin avatar Jun 29 '18 06:06 OGKevin

@OGKevin Hi Kevin, I can do this... Just a bit busy this week. :-)

nduijvelshoff avatar Jun 29 '18 07:06 nduijvelshoff

I'll check it on Monday. Off for the weekend.

On Jun 29, 2018 16:34, Kevin Hellemun [email protected] wrote:

@OGKevin commented on this pull request.


In BunqSdk/Http/RetryHandler.cshttps://github.com/bunq/sdk_csharp/pull/106#discussion_r199178975:

+using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Polly;

+namespace Bunq.Sdk.Http +{

  • public class RetryHandler : DelegatingHandler
  • {
  •    public RetryHandler(HttpClientHandler handler) : base(handler) { }
    
  •    protected override Task<HttpResponseMessage> SendAsync(
    
  •        HttpRequestMessage request,
    
  •        CancellationToken cancellationToken) =>
    
  •        Policy
    
  •            .Handle<HttpRequestException>()
    

Hmm i meant to only retry when this exception is thrown TooManyRequestsException Cant you use this exception to catch and handle ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bunq/sdk_csharp/pull/106#discussion_r199178975, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADmub1dzoiWAyt2hlIhFrXIanwq58DQEks5uBjrhgaJpZM4UzoCV.

nduijvelshoff avatar Jun 29 '18 14:06 nduijvelshoff