Method ShouldRetry
ShouldRetry(Request)
Determines whether the operation should be retried.
Declaration
bool ShouldRetry(Request request)
Parameters
Type | Name | Description |
---|---|---|
Request | request | The Request object describing the running operation. |
Returns
Type | Description |
---|---|
Boolean | true to retry the operation, otherwise
false . |
Remarks
This method is called every time after an operation fails with a retryable exception. The operations may be retried multiple times. This method is called before each retry. The retries will continue until one of the following occurs:
- The operation is successful.
-
This method returns
false
. - The operation timeout elapses.
The Request object includes information on the number of retries done so far (see RetryCount) as well as all the exceptions occurred during previous retries (see Exceptions and LastException). You may decide whether the operation should be retried based on this information as well as any operation-specific information provided by the Request instance.