Beispiel #1
0
 public static Task <T> ScrapeWithExponentialRetries <T>(Func <int, Task <T> > scraper, int hltbId)
 {
     return(ExponentialBackoff.ExecuteAsyncWithExponentialRetries(
                () => scraper(hltbId),
                (lastException, retryCount, delay) =>
                HltbScraperEventSource.Log.TransientHltbFault(hltbId, lastException.Message, retryCount, ScrapingRetries, (int)delay.TotalSeconds),
                ex => ex is TransientHltbFaultException,
                ScrapingRetries, HttpRetryClient.MinBackoff, HttpRetryClient.MaxBackoff, HttpRetryClient.DefaultClientBackoff,
                CancellationToken.None));
 }