test: debug for init window

This commit is contained in:
alikia2x (寒寒) 2025-03-24 04:05:22 +08:00
parent cb573e55d9
commit 20731c0530
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6

View File

@ -39,7 +39,8 @@ export async function refreshSnapshotWindowCounts(client: Client, redisClient: R
for (const row of result.rows) {
const targetOffset = Math.floor((row.window_start.getTime() - startTime) / (5 * MINUTE));
const offset = (currentWindow + targetOffset) % WINDOW_SIZE;
const offset = (currentWindow + targetOffset);
logger.debug(`window_start: ${row.window_start}, count: ${row.count}, offset: ${offset}`);
if (offset >= 0 && offset < WINDOW_SIZE) {
await redisClient.hset(REDIS_KEY, offset.toString(), Number(row.count));
}