Skip to content

Commit c7420de

Browse files
author
carldai
committed
fix
1 parent 871cb9c commit c7420de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/metric/repository.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package metric
33
import (
44
"context"
55
"fmt"
6+
"strings"
67
"time"
78

89
"github.com/tencentyun/tencentcloud-exporter/pkg/util"
@@ -166,7 +167,7 @@ func (repo *TcmMetricRepositoryImpl) getMonitorDataWithRetry(
166167
for i := 0; i < 3; i++ {
167168
resp, err := monitorClient.GetMonitorData(request)
168169
if err != nil {
169-
if err.Error() == context.DeadlineExceeded.Error() {
170+
if strings.Contains(err.Error(), context.DeadlineExceeded.Error()) {
170171
lastErr = err
171172
continue
172173
}

0 commit comments

Comments
 (0)