fix(proxy): 完善备用补提与失败组暂停
- 备用不足不再触发活动代理池重建\n- 白名单 verify 限频错误保留消息并允许重试\n- 严格模式失败组暂停请求并持续补提取\n- 增加备用代理健康探测与运行门禁校验
This commit is contained in:
+15
-4
@@ -243,14 +243,25 @@ func (p *IPZanProvider) verifyWhitelist(ctx context.Context, httpClient *http.Cl
|
||||
return false, err
|
||||
}
|
||||
var payload struct {
|
||||
Code *int `json:"code"`
|
||||
Data json.RawMessage `json:"data"`
|
||||
Code *int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Info string `json:"info"`
|
||||
Msg string `json:"msg"`
|
||||
Data json.RawMessage `json:"data"`
|
||||
}
|
||||
if err := json.Unmarshal(body, &payload); err != nil {
|
||||
return false, fmt.Errorf("解析品赞白名单校验响应失败: %w", err)
|
||||
}
|
||||
if payload.Code == nil || *payload.Code != 0 {
|
||||
return false, &ProviderError{Provider: "品赞", Message: "白名单校验失败", Fatal: true}
|
||||
if payload.Code == nil {
|
||||
return false, fmt.Errorf("品赞白名单校验响应缺少 code: %s", truncateText(string(body), 120))
|
||||
}
|
||||
if *payload.Code != 0 {
|
||||
message := firstNonEmpty(payload.Message, payload.Info, payload.Msg, "品赞返回未知错误")
|
||||
return false, &ProviderError{
|
||||
Provider: "品赞",
|
||||
Message: "校验白名单失败: " + message,
|
||||
Fatal: isIPZanFatalMessage(message),
|
||||
}
|
||||
}
|
||||
var exists bool
|
||||
if json.Unmarshal(payload.Data, &exists) == nil {
|
||||
|
||||
Reference in New Issue
Block a user