feat: improve xiaodian seckill flow
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
|
||||
"douyu_go/internal/activity"
|
||||
"douyu_go/internal/client"
|
||||
@@ -140,6 +141,9 @@ func (a *App) Startup(ctx context.Context) {
|
||||
a.client = client.New(act, a.cfg.TimeAPIURL, a.getTrace())
|
||||
a.font = imgpkg.LoadFont(a.paths.FontFiles)
|
||||
a.scheduler = seckill.New(a.client, a.paths, a.font, a.cfg.Concurrency, a.cfg.Attempts, a.cfg.RetryStages, a.cfg.SeckillMode)
|
||||
a.scheduler.SetStateChangeCallback(func(state string) {
|
||||
runtime.EventsEmit(a.ctx, seckillStateEvent, state)
|
||||
})
|
||||
a.scheduler.LoadAccounts()
|
||||
|
||||
if err := os.MkdirAll(a.paths.SuccessDir, 0755); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user