From 4cf1762467c535b059bcccca0f74810dd4233c70 Mon Sep 17 00:00:00 2001 From: IanShaw027 <131567472+IanShaw027@users.noreply.github.com> Date: Fri, 5 Dec 2025 02:21:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20ESLint=20curly=20?= =?UTF-8?q?=E8=A7=84=E5=88=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 if 语句后添加必需的大括号 - 修复 unifiedClaudeScheduler.js (1处) - 修复 unstableUpstreamHelper.js (2处) --- src/services/unifiedClaudeScheduler.js | 4 +++- src/utils/unstableUpstreamHelper.js | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/services/unifiedClaudeScheduler.js b/src/services/unifiedClaudeScheduler.js index 73def6a8..54446ec7 100644 --- a/src/services/unifiedClaudeScheduler.js +++ b/src/services/unifiedClaudeScheduler.js @@ -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` ) diff --git a/src/utils/unstableUpstreamHelper.js b/src/utils/unstableUpstreamHelper.js index c233fc3c..6fa58aca 100644 --- a/src/utils/unstableUpstreamHelper.js +++ b/src/utils/unstableUpstreamHelper.js @@ -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 {