Skip to content

Commit

Permalink
fix: icodef 题库IP超出每日限额后不重试
Browse files Browse the repository at this point in the history
  • Loading branch information
DokiDoki1103 committed Oct 29, 2023
1 parent 90388c3 commit 03f9500
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/search/icodef.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (in *IcodefClient) getHTTPClient() *resty.Client {
SetRetryCount(3).
SetRetryWaitTime(time.Second).
AddRetryCondition(func(r *resty.Response, err error) bool {
return err != nil || strings.Contains(r.String(), "触发流控限制")
return err != nil || (strings.Contains(r.String(), "触发流控限制") && !strings.Contains(r.String(), "IP超出每日限额"))
}).
AddRetryHook(func(r *resty.Response, err error) {
logger.SysError(fmt.Sprintf("iCodef触发流控限制,正在重试...%s", r.String()))
Expand Down

0 comments on commit 03f9500

Please sign in to comment.