This repository was archived by the owner on Oct 22, 2026. It is now read-only.
Repository navigation
feat(server): make sticky rotation limit configurable - #191
Open
wzwjustdoit wants to merge 2 commits into
Open
wzwjustdoit wants to merge 2 commits into
wzwjustdoit wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
让粘性路由轮换阈值可配置
背景
internal/server/handler.go原先将同渠道粘性账号的轮换阈值硬编码为50。本 PR 新增server.sticky_max_requests,允许通过config.json调整连续成功使用多少次后轮换账号。配置
{ "server": { "max_request_body_mb": 128, "sticky_max_requests": 50 } }500或负数50非法值不会阻止程序启动,日志格式如下:
实现
internal/configserver.sticky_max_requests字段。50。cmd/wild-workserver.Handler。internal/server50。config.example.jsonserver.sticky_max_requests: 50。兼容性
50。验证
go test ./...go vet ./...git diff --checkdist/wild-work.exe回归覆盖
0与负数触发 warning 并回退到50,且加载过程不写盘。Handler且未传入新字段时,仍兼容回落默认值50。提交
83077ed feat(server): make sticky rotation limit configurable0442ee3 style(config): use structured warning log for sticky limit