mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
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:
@@ -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`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user