Skip to content

Commit

Permalink
Updated RetryHandler. (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
nduijvelshoff committed Jun 29, 2018
1 parent b1a72ad commit 8ce7884
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions BunqSdk/Http/RetryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ protected override Task<HttpResponseMessage> SendAsync(
CancellationToken cancellationToken) =>
Policy
.Handle<HttpRequestException>()
.Or<TaskCanceledException>()
.OrResult<HttpResponseMessage>(x => !x.IsSuccessStatusCode)
.OrResult<HttpResponseMessage>(x => x.StatusCode == (System.Net.HttpStatusCode)429)
.WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(3, retryAttempt)))
.ExecuteAsync(() => base.SendAsync(request, cancellationToken));
}
}
}

0 comments on commit 8ce7884

Please sign in to comment.