From 0e84a979e9ab05289757e802daf7ad21a397aa4b Mon Sep 17 00:00:00 2001 From: KevinLiao Date: Thu, 31 Jul 2025 13:36:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=A7=E7=BB=AD=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E7=AA=97=E5=8F=A3=E7=9A=84=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E8=BF=99=E5=9B=9E=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/claudeAccountService.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/services/claudeAccountService.js b/src/services/claudeAccountService.js index 48747cbc..beee7016 100644 --- a/src/services/claudeAccountService.js +++ b/src/services/claudeAccountService.js @@ -881,7 +881,7 @@ class ClaudeAccountService { accountData.sessionWindowEnd = windowEnd.toISOString(); accountData.lastRequestTime = now.toISOString(); - logger.info(`🕐 Created new session window for account ${accountData.name} (${accountId}): ${windowStart.toISOString()} - ${windowEnd.toISOString()}`); + logger.info(`🕐 Created new session window for account ${accountData.name} (${accountId}): ${windowStart.toISOString()} - ${windowEnd.toISOString()} (from current time)`); return accountData; } catch (error) { @@ -892,11 +892,8 @@ class ClaudeAccountService { // 🕐 计算会话窗口开始时间 _calculateSessionWindowStart(requestTime) { - const hour = requestTime.getHours(); - const windowStartHour = Math.floor(hour / 5) * 5; // 向下取整到最近的5小时边界 - + // 从当前时间开始创建窗口,只将分钟取整到整点 const windowStart = new Date(requestTime); - windowStart.setHours(windowStartHour); windowStart.setMinutes(0); windowStart.setSeconds(0); windowStart.setMilliseconds(0);