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:
+1
-1
@@ -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,
|
||||
|
||||
@@ -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 秒异步预热,不阻塞发令枪)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user