From 578d3ca34bd4b299007b56ea6271b43fa4441031 Mon Sep 17 00:00:00 2001 From: leslie Date: Fri, 25 Jul 2025 22:08:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=AE=A1=E6=AC=A1=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/apiKeyService.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/services/apiKeyService.js b/src/services/apiKeyService.js index e53976c2..052aef6e 100644 --- a/src/services/apiKeyService.js +++ b/src/services/apiKeyService.js @@ -253,12 +253,8 @@ class ApiKeyService { if (accountId) { await redis.incrementAccountUsage(accountId, totalTokens, inputTokens, outputTokens, cacheCreateTokens, cacheReadTokens, model); logger.database(`📊 Recorded account usage: ${accountId} - ${totalTokens} tokens (API Key: ${keyId})`); - } else if (keyData.claudeAccountId) { - // 如果没有传入accountId,但API Key绑定了专属账户,也记录统计 - await redis.incrementAccountUsage(keyData.claudeAccountId, totalTokens, inputTokens, outputTokens, cacheCreateTokens, cacheReadTokens, model); - logger.database(`📊 Recorded account usage (from API Key binding): ${keyData.claudeAccountId} - ${totalTokens} tokens (API Key: ${keyId})`); } else { - logger.debug(`⚠️ No accountId provided and API Key not bound to account, skipping account-level statistics`); + logger.debug(`⚠️ No accountId provided for usage recording, skipping account-level statistics`); } }