From 34b63891135afeb798e697f5d7b1cfdaa2105e86 Mon Sep 17 00:00:00 2001 From: arunma Date: Tue, 24 Dec 2024 10:27:24 +0800 Subject: [PATCH] fix: modify read --- .../monitor/service_tencentcloud_monitor.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tencentcloud/services/monitor/service_tencentcloud_monitor.go b/tencentcloud/services/monitor/service_tencentcloud_monitor.go index 6a20980eb5..6e222e7338 100644 --- a/tencentcloud/services/monitor/service_tencentcloud_monitor.go +++ b/tencentcloud/services/monitor/service_tencentcloud_monitor.go @@ -2613,6 +2613,7 @@ func (me *MonitorService) DescribeMonitorTmpMultipleWritesById(ctx context.Conte logId := tccommon.GetLogId(ctx) request := monitorv20180724.NewDescribeRemoteURLsRequest() + response := monitorv20180724.NewDescribeRemoteURLsResponse() request.InstanceId = helper.String(instanceId) request.RemoteURLs = []*string{helper.String(url)} @@ -2624,7 +2625,19 @@ func (me *MonitorService) DescribeMonitorTmpMultipleWritesById(ctx context.Conte ratelimit.Check(request.GetAction()) - response, err := me.client.UseMonitorV20180724Client().DescribeRemoteURLs(request) + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := me.client.UseMonitorV20180724Client().DescribeRemoteURLs(request) + if e != nil { + return tccommon.RetryError(e) + } + if result == nil { + e = fmt.Errorf("tmp `DescribeRemoteURLs` response not exists") + return resource.NonRetryableError(e) + } + + response = result + return nil + }) if err != nil { errRet = err return