From 3564bf5c66382b92a2ac7b23c300f8854058b700 Mon Sep 17 00:00:00 2001 From: taichanne30 Date: Thu, 25 Jul 2024 14:37:09 +0900 Subject: [PATCH] Refactor: const naming --- packages/backend/src/core/FanoutTimelineEndpointService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/FanoutTimelineEndpointService.ts b/packages/backend/src/core/FanoutTimelineEndpointService.ts index 55ef7abf3c..6c874db9d1 100644 --- a/packages/backend/src/core/FanoutTimelineEndpointService.ts +++ b/packages/backend/src/core/FanoutTimelineEndpointService.ts @@ -67,12 +67,12 @@ export class FanoutTimelineEndpointService { let shouldFallbackToDb = ps.useDbFallback && (redisResult.length > 1 && redisResult.some(ids => ids.length === 0)); // 取得したresultの中で最古のIDのうち、最も新しいものを取得 - const thresholdId = redisResult.map(ids => ids[0]).sort()[0]; + const fttThresholdId = redisResult.map(ids => ids[0]).sort()[0]; // TODO: いい感じにgetMulti内でソート済だからuniqするときにredisResultが全てソート済なのを利用して再ソートを避けたい const redisResultIds = shouldFallbackToDb ? [] : Array.from(new Set(redisResult.flat(1))).sort(idCompare); - let noteIds = redisResultIds.filter(id => id >= thresholdId).slice(0, ps.limit); + let noteIds = redisResultIds.filter(id => id >= fttThresholdId).slice(0, ps.limit); const oldestNoteId = ascending ? redisResultIds[0] : redisResultIds[redisResultIds.length - 1]; shouldFallbackToDb ||= noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId;