Repository navigation
fix(runtime): 跨账号限速定时签到与 Keepalive - #373
Merged
Merged
Conversation
…unts Each 30s maintenance tick processes at most 2 due accounts, with ~2s + FNV jitter between them, so a large AutoCheckin fleet no longer bursts upstream after the configured time or after 22:00 keepalive.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
用户怀疑一次性打太猛触发上游风控。跨账号本已是顺序 for,但无账号间隔;09:00 过点后一个 tick 会背靠背打完所有 due,Keepalive 在 ≥22 点第一次 tick 一次扫完。
本 PR 在现有顺序循环上加保守突发限速(不引入新限流框架、不改签到成功/already/额度语义、不默认改 CheckinTime):
runScheduledCheckins:每 30s tick 最多处理 2 个 due 账号;账号之间baseDelay=2s+ FNV 小 jitter(0~999ms);剩余 due 留到后续 tick。KeepaliveWorkBuddy:同样 per-tick cap=2 + 间隔;RunMaintenanceLoop在 22:00 后跨 tick 续跑,用donemap 记当日已刷账号;单次调用超时由 2min 改为按批 90s。python3 scripts/release-notes.py validate已过。默认:
maintenancePerTickCap=2,maintenanceAccountGap=2s(+0~999ms jitter),keepalive 单 tick 超时 90s。Test plan
go test ./internal/runtime/ -count=1(含新增TestRunScheduledCheckinsCapsPerTick/TestKeepaliveWorkBuddyCapsPerTickAndResumes)python3 scripts/release-notes.py validate不要 merge(按需求仅开 PR)。