fix: 修复claude账号限流不会自动恢复的bug

This commit is contained in:
shaw
2025-09-24 09:36:42 +08:00
parent 598b101f02
commit 00faa21e4b
2 changed files with 13 additions and 6 deletions

View File

@@ -1190,6 +1190,8 @@ class ClaudeAccountService {
throw new Error('Account not found')
}
const accountKey = `claude:account:${accountId}`
// 清除限流状态
delete accountData.rateLimitedAt
delete accountData.rateLimitStatus
@@ -1210,6 +1212,15 @@ class ClaudeAccountService {
}
await redis.setClaudeAccount(accountId, accountData)
// 显式删除Redis中的限流字段避免旧标记阻止账号恢复调度
await redis.client.hdel(
accountKey,
'rateLimitedAt',
'rateLimitStatus',
'rateLimitEndAt',
'rateLimitAutoStopped'
)
logger.success(`✅ Rate limit removed for account: ${accountData.name} (${accountId})`)
return { success: true }