Add usage queue worker autoscaling

This commit is contained in:
elky
2026-06-26 14:02:57 +08:00
parent 6c5e70ccb1
commit 7e9424008f
21 changed files with 1801 additions and 85 deletions
@@ -588,6 +588,7 @@ const form = ref({
account_self_check_interval_minutes: null as number | null | undefined,
account_self_check_concurrency: null as number | null | undefined,
auto_remove_banned_keys: false,
auto_remove_quota_exhausted_keys: false,
skip_exhausted_accounts: false,
})
@@ -625,6 +626,8 @@ function getHealthToggleValue(key: PoolHealthToggleKey): boolean {
return form.value.account_self_check_enabled
case 'auto_remove_banned_keys':
return form.value.auto_remove_banned_keys
case 'auto_remove_quota_exhausted_keys':
return form.value.auto_remove_quota_exhausted_keys
case 'skip_exhausted_accounts':
return form.value.skip_exhausted_accounts
}
@@ -641,6 +644,9 @@ function updateHealthToggleValue(key: PoolHealthToggleKey, value: boolean): void
case 'auto_remove_banned_keys':
form.value.auto_remove_banned_keys = value
return
case 'auto_remove_quota_exhausted_keys':
form.value.auto_remove_quota_exhausted_keys = value
return
case 'skip_exhausted_accounts':
form.value.skip_exhausted_accounts = value
}
@@ -675,6 +681,7 @@ watch(() => props.modelValue, (open) => {
account_self_check_interval_minutes: cfg?.account_self_check_interval_minutes ?? null,
account_self_check_concurrency: cfg?.account_self_check_concurrency ?? null,
auto_remove_banned_keys: cfg?.auto_remove_banned_keys ?? false,
auto_remove_quota_exhausted_keys: cfg?.auto_remove_quota_exhausted_keys ?? false,
skip_exhausted_accounts: cfg?.skip_exhausted_accounts ?? false,
}
@@ -751,6 +758,7 @@ async function handleSave() {
? (form.value.account_self_check_concurrency ?? undefined)
: undefined,
auto_remove_banned_keys: form.value.auto_remove_banned_keys,
auto_remove_quota_exhausted_keys: form.value.auto_remove_quota_exhausted_keys,
skip_exhausted_accounts: form.value.skip_exhausted_accounts,
}
@@ -11,6 +11,7 @@ describe('poolAdvancedDialog', () => {
'probing_enabled',
'account_self_check_enabled',
'auto_remove_banned_keys',
'auto_remove_quota_exhausted_keys',
'skip_exhausted_accounts',
])
})
@@ -32,6 +33,11 @@ describe('poolAdvancedDialog', () => {
label: '异常自动清除',
description: '检测到不可恢复账号异常,或 RT 与 AT 均失效时自动从号池移除。',
},
{
key: 'auto_remove_quota_exhausted_keys',
label: '自动清理额度耗尽',
description: '探测到黑色“额度耗尽”账号后自动从号池移除。',
},
{
key: 'skip_exhausted_accounts',
label: '跳过额度耗尽账号',
@@ -2,6 +2,7 @@ export type PoolHealthToggleKey =
| 'probing_enabled'
| 'account_self_check_enabled'
| 'auto_remove_banned_keys'
| 'auto_remove_quota_exhausted_keys'
| 'skip_exhausted_accounts'
export interface PoolHealthToggleCard {
@@ -32,6 +33,11 @@ export function buildPoolHealthToggleCards(): PoolHealthToggleCard[] {
label: '异常自动清除',
description: '检测到不可恢复账号异常,或 RT 与 AT 均失效时自动从号池移除。',
},
{
key: 'auto_remove_quota_exhausted_keys',
label: '自动清理额度耗尽',
description: '探测到黑色“额度耗尽”账号后自动从号池移除。',
},
{
key: 'skip_exhausted_accounts',
label: '跳过额度耗尽账号',