@@ -65,23 +65,7 @@ func init() {
6565}
6666
6767func GetRetryBackoffDuration (response oci_common.OCIOperationResponse , disableNotFoundRetries bool , service string , startTime time.Time , optionals ... interface {}) time.Duration {
68- backoffDuration := getRetryBackoffDurationWithExpectedRetryDurationFn (response , disableNotFoundRetries , service , startTime , getExpectedRetryDuration , optionals ... )
69- // Do nothing if service specific retry duration exists
70- if _ , ok := serviceExpectedRetryDurationMap [service ]; ok {
71- return backoffDuration
72- }
73- if response .Response != nil && response .Response .HTTPResponse () != nil {
74- statusCode := response .Response .HTTPResponse ().StatusCode
75- switch statusCode {
76- case 429 :
77- utils .Logf ("[DEGUG] Handling Retry Timeout for API Response Error Code 429" )
78- utils .Logf ("[DEGUG] Retry Timeout before handling API Response Error Code 429 is %s" , backoffDuration )
79- expectedRetryDuration := getExpectedRetryDuration (response , disableNotFoundRetries , service , optionals ... )
80- backoffDuration = backoffDuration + expectedRetryDuration
81- utils .Logf ("[DEGUG] Retry Timeout after handling API Response Error Code 429 is %s" , backoffDuration )
82- }
83- }
84- return backoffDuration
68+ return getRetryBackoffDurationWithExpectedRetryDurationFn (response , disableNotFoundRetries , service , startTime , getExpectedRetryDuration , optionals ... )
8569}
8670
8771func getRetryBackoffDurationWithExpectedRetryDurationFn (response oci_common.OCIOperationResponse , disableNotFoundRetries bool , service string , startTime time.Time , expectedRetryDurationFn expectedRetryDurationFn , optionals ... interface {}) time.Duration {
0 commit comments