Index: Src/GoogleApis/Apis/Services/BaseClientService.cs =================================================================== --- a/Src/GoogleApis/Apis/Services/BaseClientService.cs +++ b/Src/GoogleApis/Apis/Services/BaseClientService.cs @@ -54,7 +54,7 @@ #region Initializer /// - /// Indicates if exponential back-off is used automatically on exception in a service request and\or when 5xx + /// Indicates if exponential back-off is used automatically on exception in a service request and\or when 503 /// response is returned form the server. /// [Flags] @@ -62,7 +62,7 @@ { None = 0, Exception = 1, - UnsuccessfulResponse5xx = 2 + UnsuccessfulResponse503 = 2 } /// An initializer class for the client service. @@ -82,9 +82,9 @@ public IConfigurableHttpClientInitializer HttpClientInitializer { get; set; } /// - /// Gets or sets the exponential back-off policy used by the service. Default value is Exception | - /// UnsuccessfulResponse5xx, which means that exponential back-off is used on any 5xx abnormal Http - /// response and on any exception whose thrown when sending a request (except task canceled exception). + /// Get or sets the exponential back-off policy used by the service. Default value is + /// UnsuccessfulResponse503, which means that exponential back-off is used on 503 abnormal HTTP + /// response. /// If the value is set to None, no exponential back-off policy is used, and it's up to user to /// configure the in an /// to set a specific back-off @@ -120,8 +120,7 @@ GZipEnabled = true; Serializer = new NewtonsoftJsonSerializer(); Authenticator = NullAuthenticator.Instance; - DefaultExponentialBackOffPolicy = ExponentialBackOffPolicy.Exception | - ExponentialBackOffPolicy.UnsuccessfulResponse5xx; + DefaultExponentialBackOffPolicy = ExponentialBackOffPolicy.UnsuccessfulResponse503; } } @@ -153,8 +152,8 @@ httpClient.MessageHandler.ExceptionHandlers.Add(backOff); } - if ((Policy & ExponentialBackOffPolicy.UnsuccessfulResponse5xx) == - ExponentialBackOffPolicy.UnsuccessfulResponse5xx) + if ((Policy & ExponentialBackOffPolicy.UnsuccessfulResponse503) == + ExponentialBackOffPolicy.UnsuccessfulResponse503) { httpClient.MessageHandler.UnsuccessfulResponseHandlers.Add(backOff); } @@ -182,9 +181,7 @@ HttpClient = CreateHttpClient(initializer); } - /// - /// Return true if this service contains the specified feature. - /// + /// Return true if this service contains the specified feature. private bool HasFeature(Features feature) { return Features.Contains(feature.GetStringValue());