Exemplo n.º 1
0
        public static ActionPolicyAsync CreateSubmitAsync(Func <string> additionalLogInfo = null)
        {
            return(ActionPolicyAsync.Handle <Exception>().RetryAsync(RetryCount, async(ex, i) =>
            {
                var delay = GetDelay(ex, i);
                var message = CreateRetryMessage(additionalLogInfo, i, delay, ex);
                ChannelAdvisorLogger.LogTrace(ex, message);

                await Task.Delay(delay).ConfigureAwait(false);
            }));
        }
Exemplo n.º 2
0
        public static ActionPolicy CreateSubmit(Func <string> additionalLogInfo = null)
        {
            return(ActionPolicy.Handle <Exception>().Retry(RetryCount, (ex, i) =>
            {
                var delay = GetDelay(ex, i);
                var message = CreateRetryMessage(additionalLogInfo, i, delay, ex);
                ChannelAdvisorLogger.LogTrace(ex, message);

                SystemUtil.Sleep(delay);
            }));
        }