feat(config): 默认并发调优至 30 并将全套抢购设置置为开箱即用
- 默认并发调优至 30:匹配单实例 30 账号最佳配置,配合 300ms 首发错峰使 30 账号全员在 0~300ms 免排队出击,5 实例多开整机在途约 150 - 前后端默认值与平滑迁移:对齐 Concurrency 30、DelayMS 120、WindowSeconds 30、SID 2203 等,旧配置自动升级 - 测试验证:全套 Go 单元测试通过,前端 Vite 构建成功
This commit is contained in:
@@ -61,12 +61,11 @@ const configStorageBase = 'huya-go.gui.config.v2'
|
||||
const cookieStorageBase = 'huya-go.gui.cookies.v1'
|
||||
const prizeCacheStorageBase = 'huya-go.gui.prizes.v1'
|
||||
const leadDefaultMigrationBase = 'huya-go.gui.lead-default.v1'
|
||||
// 旧版本默认把提前量写成 2500ms、线程写成 5。轮次上限已从产品移除;
|
||||
// 线程 5 在多开时会放大请求洪峰,旧默认只迁移一次。
|
||||
// 旧版本默认把提前量写成 2500ms、线程写成 5 或 2。
|
||||
// 现已调优为单实例 30 账号免排队出击(默认 30 并发)。
|
||||
const legacyDefaultLeadMs = 2500
|
||||
const concurrencyDefaultMigrationBase = 'huya-go.gui.concurrency-pressure.v1'
|
||||
const legacyDefaultConcurrency = 5
|
||||
const defaultConcurrency = 2
|
||||
const concurrencyDefaultMigrationBase = 'huya-go.gui.concurrency-v30.v1'
|
||||
const defaultConcurrency = 30
|
||||
|
||||
// 界面本地存储保留的日志上限,与后端的增量拉取配合使用。
|
||||
const maxClientLogs = 1000
|
||||
@@ -555,7 +554,7 @@ function readSavedConfig(): Partial<SavedConfig> {
|
||||
|
||||
const concurrencyMigrationKey = scopedKey(concurrencyDefaultMigrationBase)
|
||||
if (!localStorage.getItem(concurrencyMigrationKey)) {
|
||||
if (Number(saved.concurrency || 0) === legacyDefaultConcurrency) {
|
||||
if (Number(saved.concurrency || 0) <= 5) {
|
||||
saved.concurrency = defaultConcurrency
|
||||
dirty = true
|
||||
}
|
||||
@@ -669,7 +668,7 @@ function pickConfig(values: Partial<UiConfig>): UiConfig {
|
||||
return {
|
||||
transport: values.transport || 'wss',
|
||||
wssHost: values.wssHost || '',
|
||||
sid: Number(values.sid || 0),
|
||||
sid: Number(values.sid || 2203),
|
||||
pid: Number(values.pid || 0),
|
||||
name: values.name || '',
|
||||
category: values.category || '',
|
||||
@@ -678,7 +677,7 @@ function pickConfig(values: Partial<UiConfig>): UiConfig {
|
||||
minLeft: Number(values.minLeft || 0),
|
||||
cookieText: values.cookieText || '',
|
||||
selectedAccountLines: values.selectedAccountLines || [],
|
||||
delayMs: Number(values.delayMs || 150),
|
||||
delayMs: Number(values.delayMs || 120),
|
||||
concurrency: Number(values.concurrency || defaultConcurrency),
|
||||
windowSeconds: Number(values.windowSeconds || 30),
|
||||
stopAfterSuccess: Boolean(values.stopAfterSuccess),
|
||||
@@ -2290,7 +2289,7 @@ export default function Dashboard() {
|
||||
<Form.Item name="delayMs" label="延时">
|
||||
<InputNumber min={10} max={60000} addonAfter="ms" />
|
||||
</Form.Item>
|
||||
<Form.Item name="concurrency" label="线程" tooltip="同时在途请求上限,不是账号槽位;多开时同机总速率约为线程×实例数,限流严重时建议 1~2">
|
||||
<Form.Item name="concurrency" label="线程" tooltip="同时在途请求上限,默认 30。保证单实例 30 账号在开抢首波 300ms 错峰期间全员免排队出击;5 实例多开整机并发在途约 150">
|
||||
<InputNumber min={1} max={100} />
|
||||
</Form.Item>
|
||||
<Form.Item name="leadMs" label="提前" tooltip="留空或 0 = 按服务端时钟校准误差动态计算(通常几十毫秒);填了就用固定提前量">
|
||||
|
||||
Reference in New Issue
Block a user