Skip to content

Commit

Permalink
perf: optimize retry policy
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Jul 22, 2021
1 parent b799d4a commit 6b54b13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions task/status/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func requestServerAPI(url string) (data types.APIStatusResponseData, err error)
client := resty.New()
client.
// 设置重试逻辑
SetRetryCount(3). // 重试次数
SetRetryWaitTime(1 * time.Second).
SetRetryMaxWaitTime(3 * time.Second).
SetTimeout(2 * time.Second)
SetRetryCount(2). // 重试次数
SetRetryWaitTime(200 * time.Millisecond).
SetRetryMaxWaitTime(2 * time.Second).
SetTimeout(1 * time.Second)
responseData, e := client.
R().
EnableTrace().
Expand Down

0 comments on commit 6b54b13

Please sign in to comment.