Ejemplo n.º 1
0
 /// <summary>
 /// Virtual method that gets called when a retry request is initiated. If retry throttling is
 /// enabled, the value returned is true if the required capacity is retured, false otherwise.
 /// If retry throttling is disabled, true is returned.
 /// </summary>
 /// <param name="executionContext">The execution context which contains both the
 /// requests and response context.</param>
 /// <param name="bypassAcquireCapacity">true to bypass any attempt to acquire capacity on a retry</param>
 /// <param name="isThrottlingError">true if the error that will be retried is a throtting error</param>
 public override bool OnRetry(IExecutionContext executionContext, bool bypassAcquireCapacity, bool isThrottlingError)
 {
     if (!bypassAcquireCapacity && executionContext.RequestContext.ClientConfig.ThrottleRetries && RetryCapacity != null)
     {
         return(CapacityManagerInstance.TryAcquireCapacity(RetryCapacity, executionContext.RequestContext.LastCapacityType));
     }
     else
     {
         return(true);
     }
 }