Skip to content

Commit 3a5c07f

Browse files
WeiMengXSWeiMengXS
andauthored
feat: support async task (#2357)
* feat: support async task * feat: support async task limit --------- Co-authored-by: WeiMengXS <nickcchen@tencent.com>
1 parent 6f81d63 commit 3a5c07f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.changelog/2357.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_clb_target_group_attachment: Support async task limit
3+
```

tencentcloud/service_tencentcloud_clb.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,11 @@ func (me *ClbService) AssociateTargetGroups(ctx context.Context, listenerId, clb
12991299
ratelimit.Check(request.GetAction())
13001300
response, err := me.client.UseClbClient().AssociateTargetGroups(request)
13011301
if err != nil {
1302+
if e, ok := err.(*sdkErrors.TencentCloudSDKError); ok {
1303+
if strings.Contains(e.GetMessage(), "Your task is working (AssociateTargetGroups)") {
1304+
return resource.RetryableError(e)
1305+
}
1306+
}
13021307
return retryError(err, InternalError)
13031308
} else {
13041309
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
@@ -1378,6 +1383,11 @@ func (me *ClbService) DisassociateTargetGroups(ctx context.Context, targetGroupI
13781383
ratelimit.Check(request.GetAction())
13791384
_, err := me.client.UseClbClient().DisassociateTargetGroups(request)
13801385
if err != nil {
1386+
if e, ok := err.(*sdkErrors.TencentCloudSDKError); ok {
1387+
if strings.Contains(e.GetMessage(), "Your task is working (DisassociateTargetGroups)") {
1388+
return resource.RetryableError(e)
1389+
}
1390+
}
13811391
return retryError(err, InternalError)
13821392
}
13831393
return nil

0 commit comments

Comments
 (0)