Skip to content

Commit 280b262

Browse files
author
carldai
committed
fix
1 parent 8b62979 commit 280b262

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/metric/repository.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package metric
33
import (
44
"context"
55
"fmt"
6-
"strings"
76
"time"
87

98
"github.com/tencentyun/tencentcloud-exporter/pkg/util"
@@ -167,7 +166,7 @@ func (repo *TcmMetricRepositoryImpl) getMonitorDataWithRetry(
167166
for i := 0; i < 3; i++ {
168167
resp, err := monitorClient.GetMonitorData(request)
169168
if err != nil {
170-
if strings.Contains(err.Error(), "context deadline") {
169+
if err.Error() == context.DeadlineExceeded.Error() {
171170
lastErr = err
172171
continue
173172
}

0 commit comments

Comments
 (0)