docs: describe account concurrency priority
Test / test (windows-latest) (push) Failing after 1m0s
Test / test (macos-latest, 1/3) (push) Canceled after 0s
Test / test (macos-latest, 2/3) (push) Canceled after 0s
Test / test (macos-latest, 3/3) (push) Canceled after 0s
Test / test (macos-latest, gateway) (push) Canceled after 0s
Test / test (ubuntu-latest) (push) Canceled after 0s
Test / cli (linux/amd64, nogui) (push) Canceled after 0s
Test / cli (android/arm64, nogui) (push) Canceled after 0s
Docker / build (linux/amd64) (push) Failing after 1m20s
Docker / build (linux/arm64) (push) Canceled after 0s
Docker / merge (push) Canceled after 0s

This commit is contained in:
antior
2026-11-20 19:27:32 +08:00
parent ff9b0dc936
commit e5ef1b0a3d
+8 -8
View File
@@ -7,11 +7,10 @@ import (
"time"
)
// Concurrency is how many requests the gateway lets be out at the vendor
// at once on each of the provider's keys or accounts, 0 for no limit: the
// user's MaxConcurrency when they set one, else what the plugin giving the
// provider says it takes (its auth hook's maxConcurrency, or its
// package.json's magpie.maxConcurrency), else none.
// Concurrency is the provider-wide fallback for requests out at once on
// each key or account, 0 for no limit: the user's MaxConcurrency when set,
// else the plugin's static default. LaneLimit applies the account's manual
// and automatic limits before this fallback.
func (p Provider) Concurrency() int {
if p.MaxConcurrency != nil {
return max(*p.MaxConcurrency, 0)
@@ -122,9 +121,10 @@ const (
MaxQueueWait = 3600
)
// LaneLimit is how many requests may be out at once on p's key or
// account, 0 for no limit: its own (AccountConcurrency), else the
// provider's (Concurrency). An account not had from All or AlsoOn (made
// LaneLimit is how many requests may be out at once on p's key or account,
// 0 for no limit: its own AccountConcurrency, else the provider's manual
// MaxConcurrency, else the plugin's account automatic value, else the
// plugin's static default. An account not had from All or AlsoOn (made
// afresh by its sign-in) carries none of the provider's settings: they are
// read from providers.json then.
func (p Provider) LaneLimit() int {