mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
fix: 修复claude账号限流不会自动恢复的bug
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user