| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. See License.txt in the project root for license information. |
| | 3 | |
|
| | 4 | | namespace Microsoft.Azure.Batch.Common |
| | 5 | | { |
| | 6 | | using System; |
| | 7 | | using System.Threading.Tasks; |
| | 8 | |
|
| | 9 | | /// <summary> |
| | 10 | | /// Represents a retry policy that performs no retries. |
| | 11 | | /// </summary> |
| | 12 | | public class NoRetry : IRetryPolicy |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Determines if the operation should be retried and how long to wait until the next retry. This |
| | 16 | | /// implementation always returns <see cref="RetryDecision.NoRetry"/>. |
| | 17 | | /// </summary> |
| | 18 | | /// <param name="exception">An <see cref="Exception"/> object that represents the last exception encountered.</p |
| | 19 | | /// <param name="operationContext">An <see cref="OperationContext"/> object for tracking the current operation.< |
| | 20 | | /// <returns>A <see cref="RetryDecision"/> object which specifies if a retry should be performed.This |
| | 21 | | /// implementation always returns <see cref="RetryDecision.NoRetry"/>.</returns> |
| | 22 | | public Task<RetryDecision> ShouldRetryAsync(Exception exception, OperationContext operationContext) |
| | 23 | | { |
| 1 | 24 | | return Task.FromResult(RetryDecision.NoRetry); |
| | 25 | | } |
| | 26 | | } |
| | 27 | | } |