|
7 | 7 | "time" |
8 | 8 |
|
9 | 9 | tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" |
10 | | - svccdb "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cdb" |
11 | 10 | svctag "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tag" |
12 | 11 |
|
13 | 12 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" |
@@ -768,24 +767,24 @@ func resourceTencentCloudCynosdbClusterUpdate(d *schema.ResourceData, meta inter |
768 | 767 | return err |
769 | 768 | } |
770 | 769 |
|
771 | | - mysqlService := svccdb.NewMysqlService(client) |
772 | | - _ = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { |
773 | | - taskStatus, message, err := mysqlService.DescribeAsyncRequestInfo(ctx, asyncRequestId) |
774 | | - if err != nil { |
775 | | - return resource.NonRetryableError(err) |
| 770 | + // wait |
| 771 | + asyncRequestIdInt := helper.StrToInt64(asyncRequestId) |
| 772 | + err = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { |
| 773 | + resp, e := cynosdbService.DescribeFlow(ctx, asyncRequestIdInt) |
| 774 | + if e != nil { |
| 775 | + return resource.NonRetryableError(e) |
776 | 776 | } |
777 | 777 |
|
778 | | - if taskStatus == svccdb.MYSQL_TASK_STATUS_SUCCESS { |
| 778 | + if resp { |
779 | 779 | return nil |
780 | 780 | } |
781 | 781 |
|
782 | | - if taskStatus == svccdb.MYSQL_TASK_STATUS_INITIAL || taskStatus == svccdb.MYSQL_TASK_STATUS_RUNNING { |
783 | | - return resource.RetryableError(fmt.Errorf("%s modify params task status is %s", clusterId, taskStatus)) |
784 | | - } |
785 | | - |
786 | | - err = fmt.Errorf("%s create account task status is %s,we won't wait for it finish ,it show message:%s", clusterId, taskStatus, message) |
787 | | - return resource.NonRetryableError(err) |
| 782 | + return resource.RetryableError(fmt.Errorf("waiting for cynosdb cluster param updating")) |
788 | 783 | }) |
| 784 | + |
| 785 | + if err != nil { |
| 786 | + return err |
| 787 | + } |
789 | 788 | } |
790 | 789 |
|
791 | 790 | // update slave_zone |
|
0 commit comments