feat: 改进5xx错误熔断机制和重置状态功能

## 熔断机制优化
- 将5xx错误阈值从3次提升到10次,减少误触发
- 缩短临时错误恢复时间从60分钟到5分钟
- 支持所有5xx状态码(500-599)的统一处理

## 重置状态功能完善
后端 resetAccountStatus 新增清除:
- tempErrorAt 字段 (temp_error状态)
- sessionWindowStart/sessionWindowEnd 字段
- 5xx_errors Redis计数键

前端优化:
- 重置成功后强制刷新 loadAccounts(true)
- 避免缓存导致的状态显示不一致

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sczheng189
2025-09-01 21:39:39 +08:00
parent f4f88091c1
commit f2c2bdf6d6
3 changed files with 12 additions and 4 deletions

View File

@@ -207,7 +207,7 @@ class ClaudeRelayService {
logger.info(
`🔥 Account ${accountId} has ${errorCount} consecutive 5xx errors in the last 5 minutes`
)
if (errorCount >= 3) {
if (errorCount > 10) {
logger.error(
`❌ Account ${accountId} exceeded 5xx error threshold (${errorCount} errors), marking as temp_error`
)
@@ -915,7 +915,7 @@ class ClaudeRelayService {
logger.info(
`🔥 [Stream] Account ${accountId} has ${errorCount} consecutive 5xx errors in the last 5 minutes`
)
if (errorCount >= 3) {
if (errorCount > 10) {
logger.error(
`❌ [Stream] Account ${accountId} exceeded 5xx error threshold (${errorCount} errors), marking as temp_error`
)