mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:21:23 +00:00
Auth: use cooldown helper in explicit profile order
This commit is contained in:
@@ -102,13 +102,9 @@ export function resolveAuthProfileOrder(params: {
|
|||||||
const inCooldown: Array<{ profileId: string; cooldownUntil: number }> = [];
|
const inCooldown: Array<{ profileId: string; cooldownUntil: number }> = [];
|
||||||
|
|
||||||
for (const profileId of deduped) {
|
for (const profileId of deduped) {
|
||||||
const cooldownUntil = resolveProfileUnusableUntil(store.usageStats?.[profileId] ?? {}) ?? 0;
|
if (isProfileInCooldown(store, profileId)) {
|
||||||
if (
|
const cooldownUntil =
|
||||||
typeof cooldownUntil === "number" &&
|
resolveProfileUnusableUntil(store.usageStats?.[profileId] ?? {}) ?? now;
|
||||||
Number.isFinite(cooldownUntil) &&
|
|
||||||
cooldownUntil > 0 &&
|
|
||||||
now < cooldownUntil
|
|
||||||
) {
|
|
||||||
inCooldown.push({ profileId, cooldownUntil });
|
inCooldown.push({ profileId, cooldownUntil });
|
||||||
} else {
|
} else {
|
||||||
available.push(profileId);
|
available.push(profileId);
|
||||||
|
|||||||
Reference in New Issue
Block a user