From d9c1ce3482e52a613a586a174f20ac5fba22dc89 Mon Sep 17 00:00:00 2001 From: MrWolong Date: Mon, 1 Jul 2024 10:40:43 +0800 Subject: [PATCH] resource/alicloud_dcdn_domain_config: Added retry strategy for error code FlowControlError --- alicloud/resource_alicloud_dcdn_domain_config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alicloud/resource_alicloud_dcdn_domain_config.go b/alicloud/resource_alicloud_dcdn_domain_config.go index c57925c1d8be..4bab62d6eb86 100644 --- a/alicloud/resource_alicloud_dcdn_domain_config.go +++ b/alicloud/resource_alicloud_dcdn_domain_config.go @@ -113,7 +113,7 @@ func resourceAliCloudDcdnDomainConfigCreate(d *schema.ResourceData, meta interfa err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2018-01-15"), StringPointer("AK"), nil, request, &runtime) if err != nil { - if NeedRetry(err) { + if IsExpectedErrors(err, []string{"FlowControlError"}) || NeedRetry(err) { wait() return resource.RetryableError(err) } @@ -259,7 +259,7 @@ func resourceAliCloudDcdnDomainConfigUpdate(d *schema.ResourceData, meta interfa err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2018-01-15"), StringPointer("AK"), nil, request, &runtime) if err != nil { - if NeedRetry(err) { + if IsExpectedErrors(err, []string{"FlowControlError"}) || NeedRetry(err) { wait() return resource.RetryableError(err) }