Ejemplo n.º 1
0
 private void DelayBeforeRetry(PluginRetrySetting triggeredRetrySetting)
 {
     OnStatusMessageUpdate($"Delaying for [{triggeredRetrySetting.DelayBeforeRetry}] before retry...");
     if (triggeredRetrySetting.DelayBeforeRetry > TimeSpan.Zero)
     {
         Thread.Sleep(triggeredRetrySetting.DelayBeforeRetry);
     }
 }
Ejemplo n.º 2
0
        private PluginRetryAction GetRetryAction(PluginResult result)
        {
            PluginRetrySetting retrySetting = _executionData.RetrySettings[result];

            // Handle if we've exceeded retry limit
            if (retrySetting.RetryAction == PluginRetryAction.Retry && _retryCounts[result] >= retrySetting.RetryLimit)
            {
                string message = $"Retry limit of [{retrySetting.RetryLimit}] reached";
                switch (retrySetting.RetryLimitExceededAction)
                {
                case PluginRetryAction.Halt:
                    OnStatusMessageUpdate(message + ", signaling worker halt");
                    return(PluginRetryAction.Halt);

                default:
                    OnStatusMessageUpdate(message + ", continuing execution");
                    return(PluginRetryAction.Continue);
                }
            }
            else
            {
                return(retrySetting.RetryAction);
            }
        }