feat: Implement a waiting queue for account acquisition with configurable limits and updated status reporting.

This commit is contained in:
CJACK
2026-02-16 20:30:21 +08:00
parent 888a0e6bff
commit a6a87853d4
8 changed files with 265 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ func (r *Resolver) Determine(req *http.Request) (*RequestAuth, error) {
return &RequestAuth{UseConfigToken: false, DeepSeekToken: callerKey, resolver: r, TriedAccounts: map[string]bool{}}, nil
}
target := strings.TrimSpace(req.Header.Get("X-Ds2-Target-Account"))
acc, ok := r.Pool.Acquire(target, nil)
acc, ok := r.Pool.AcquireWait(ctx, target, nil)
if !ok {
return nil, ErrNoAccount
}