mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 10:20:27 +01:00
Refactor: const naming
This commit is contained in:
parent
685fc2bd9d
commit
3564bf5c66
1 changed files with 2 additions and 2 deletions
|
@ -67,12 +67,12 @@ export class FanoutTimelineEndpointService {
|
||||||
let shouldFallbackToDb = ps.useDbFallback && (redisResult.length > 1 && redisResult.some(ids => ids.length === 0));
|
let shouldFallbackToDb = ps.useDbFallback && (redisResult.length > 1 && redisResult.some(ids => ids.length === 0));
|
||||||
|
|
||||||
// 取得したresultの中で最古のIDのうち、最も新しいものを取得
|
// 取得したresultの中で最古のIDのうち、最も新しいものを取得
|
||||||
const thresholdId = redisResult.map(ids => ids[0]).sort()[0];
|
const fttThresholdId = redisResult.map(ids => ids[0]).sort()[0];
|
||||||
|
|
||||||
// TODO: いい感じにgetMulti内でソート済だからuniqするときにredisResultが全てソート済なのを利用して再ソートを避けたい
|
// TODO: いい感じにgetMulti内でソート済だからuniqするときにredisResultが全てソート済なのを利用して再ソートを避けたい
|
||||||
const redisResultIds = shouldFallbackToDb ? [] : Array.from(new Set(redisResult.flat(1))).sort(idCompare);
|
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];
|
const oldestNoteId = ascending ? redisResultIds[0] : redisResultIds[redisResultIds.length - 1];
|
||||||
shouldFallbackToDb ||= noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId;
|
shouldFallbackToDb ||= noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId;
|
||||||
|
|
Loading…
Reference in a new issue