fix: 修复 ESLint curly 规则问题

- 在 if 语句后添加必需的大括号
- 修复 unifiedClaudeScheduler.js (1处)
- 修复 unstableUpstreamHelper.js (2处)
This commit is contained in:
IanShaw027
2025-12-05 02:21:30 +08:00
parent 0d64d40654
commit 4cf1762467
2 changed files with 9 additions and 3 deletions

View File

@@ -1182,7 +1182,9 @@ class UnifiedClaudeScheduler {
const client = redis.getClientSafe()
const key = `temp_unavailable:${accountType}:${accountId}`
await client.setex(key, ttlSeconds, '1')
if (sessionHash) await this._deleteSessionMapping(sessionHash)
if (sessionHash) {
await this._deleteSessionMapping(sessionHash)
}
logger.warn(
`⏱️ Account ${accountId} (${accountType}) marked temporarily unavailable for ${ttlSeconds}s`
)

View File

@@ -1,7 +1,9 @@
const logger = require('./logger')
function parseList(envValue) {
if (!envValue) return []
if (!envValue) {
return []
}
return envValue
.split(',')
.map((s) => s.trim().toLowerCase())
@@ -13,7 +15,9 @@ const unstableKeywords = parseList(process.env.UNSTABLE_ERROR_KEYWORDS)
const unstableStatusCodes = new Set([408, 499, 502, 503, 504, 522])
function normalizeErrorPayload(payload) {
if (!payload) return {}
if (!payload) {
return {}
}
if (typeof payload === 'string') {
try {