feat(sniper): 将预热提前量调优至 10 秒并设为异步安全默认

- 预热时序重构:WarmupLead 从 2s 延长至 10s,ResyncLead 从 3s 延长至 15s;开抢前 10s 开始异步建连,开抢前 5s 全部就绪待命
- 兼顾零建连延迟与发令安全:既彻底杜绝了 2s 极限时间被慢网络超时拖垮发车的问题,又保留了首发 0 建连耗时的长连接极速优势
- 默认配置:Prewarm 恢复为默认开启,并在界面增加明确的调度行为提示
- 验证方式:go test ./... -count=1 全通,npm run build 构建通过
This commit is contained in:
yml2213
2026-10-17 18:36:39 +08:00
parent 6e5beac151
commit a135effd7a
4 changed files with 10 additions and 20 deletions
+1 -1
View File
@@ -308,7 +308,7 @@ func (a *App) DefaultConfig() Config {
Concurrency: 2,
StopAfterSuccess: false,
StopAccountAfterSuccess: true,
Prewarm: false,
Prewarm: true,
DirectExchange: true,
SharePrizeList: true,
AutoSelect: false,
+2 -2
View File
@@ -76,8 +76,8 @@ func TestDefaultConfigUsesWindowMode(t *testing.T) {
if cfg.Concurrency != 2 {
t.Fatalf("Concurrency=%d, want 2(降低多开时的请求洪峰)", cfg.Concurrency)
}
if cfg.Prewarm {
t.Fatal("Prewarm 应默认关闭,避免开抢前因单账号建连超时阻塞")
if !cfg.Prewarm {
t.Fatal("Prewarm 应默认开启(提前 10 秒异步预热,不阻塞发令枪)")
}
}