mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix:修复了重置状态只删除js对象而没有删除redis的问题
This commit is contained in:
@@ -1813,6 +1813,20 @@ class ClaudeAccountService {
|
||||
// 保存更新后的账户数据
|
||||
await redis.setClaudeAccount(accountId, updatedAccountData)
|
||||
|
||||
// 显式从 Redis 中删除这些字段(因为 HSET 不会删除现有字段)
|
||||
const fieldsToDelete = [
|
||||
'errorMessage',
|
||||
'unauthorizedAt',
|
||||
'blockedAt',
|
||||
'rateLimitedAt',
|
||||
'rateLimitStatus',
|
||||
'rateLimitEndAt',
|
||||
'tempErrorAt',
|
||||
'sessionWindowStart',
|
||||
'sessionWindowEnd'
|
||||
]
|
||||
await redis.client.hdel(`claude:account:${accountId}`, ...fieldsToDelete)
|
||||
|
||||
// 清除401错误计数
|
||||
const errorKey = `claude_account:${accountId}:401_errors`
|
||||
await redis.client.del(errorKey)
|
||||
|
||||
Reference in New Issue
Block a user