feat: 完善代理池与抢购链路,发布 0.5.0

This commit is contained in:
yml
2026-11-20 00:48:21 +08:00
parent 2f087ac7f1
commit 98b3dc4b16
28 changed files with 1522 additions and 204 deletions
+11 -2
View File
@@ -58,13 +58,21 @@ type runSettings struct {
// 具体职责拆分到同包文件:attempt.go(兑换执行)、warmup.go(预热)、
// schedule_timer.go(定时抢购)、account_store.go(账号管理)。
type Scheduler struct {
clientMu sync.RWMutex
client *client.DouyuClient
clientMu sync.RWMutex
proxyPrepareMu sync.Mutex
client *client.DouyuClient
// accountClients 按账号名路由到独立的代理客户端;未命中的账号使用 client。
accountClients map[string]*client.DouyuClient
accountClientOrder []*client.DouyuClient
accountClientsDirty bool
accountClientsExpireAt time.Time
proxyGroups map[*client.DouyuClient]*proxyRuntimeGroup
proxyStandbys []validatedProxy
proxyClientPool []*client.DouyuClient
proxyExcludedURLs map[string]struct{}
proxyStandbyTarget int
proxyPoolGeneration uint64
proxyRefillInFlight bool
paths types.AppPaths
font *truetype.Font
@@ -109,6 +117,7 @@ type Scheduler struct {
proxyAPI string
autoFetchProxyOnSchedule bool
accountsPerProxy int
proxySparePercent int
autoWhitelist bool
whitelistReplace bool
whitelistPassword string