tmp(buffer): get all sessions instead

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-02-09 06:49:07 +01:00
parent 2688a428d9
commit 0dfa77957c

View File

@@ -283,13 +283,10 @@ return "OK"
} }
for (const session of parsed) { for (const session of parsed) {
// Might be redundant check
if (session.events.length > 1) {
sessions[session.sessionId] = session.events sessions[session.sessionId] = session.events
.map((e) => getSafeJson<IClickhouseEvent>(e)) .map((e) => getSafeJson<IClickhouseEvent>(e))
.filter((e): e is IClickhouseEvent => e !== null); .filter((e): e is IClickhouseEvent => e !== null);
} }
}
return sessions; return sessions;
} }
@@ -336,7 +333,7 @@ return "OK"
let now = performance.now(); let now = performance.now();
const [sessions, regularQueueEvents] = await Promise.all([ const [sessions, regularQueueEvents] = await Promise.all([
// (A) Fetch session events // (A) Fetch session events
this.getEligableSessions({ minEventsInSession: 2 }), this.getEligableSessions({ minEventsInSession: 1 }),
// (B) Fetch no-session events // (B) Fetch no-session events
redis.lrange(this.regularQueueKey, 0, this.batchSize / 2 - 1), redis.lrange(this.regularQueueKey, 0, this.batchSize / 2 - 1),
]); ]);