This commit is contained in:
tidusjar 2016-05-17 21:21:42 +01:00
commit fb1d3a9e92
13 changed files with 50 additions and 38 deletions

View file

@ -8,7 +8,7 @@ namespace PlexRequests.Api
public static class RetryHandler
{
private static TimeSpan[] DefaultTime = new TimeSpan[] {
private static readonly TimeSpan[] DefaultTime = new TimeSpan[] {
TimeSpan.FromSeconds (2),
TimeSpan.FromSeconds(5),
TimeSpan.FromSeconds(10)};
@ -44,7 +44,7 @@ namespace PlexRequests.Api
timeSpan = DefaultTime;
}
var policy = Policy.Handle<Exception> ()
.WaitAndRetry(timeSpan, (exception, ts) => action(exception, ts));
.WaitAndRetry(timeSpan, action);
return policy;
}