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 {