fix(worker): try improve speed
This commit is contained in:
@@ -3,6 +3,8 @@ import { last } from 'ramda';
|
|||||||
|
|
||||||
import { getTime } from '@openpanel/common';
|
import { getTime } from '@openpanel/common';
|
||||||
import {
|
import {
|
||||||
|
IClickhouseEvent,
|
||||||
|
type IServiceEvent,
|
||||||
TABLE_NAMES,
|
TABLE_NAMES,
|
||||||
createEvent,
|
createEvent,
|
||||||
eventBuffer,
|
eventBuffer,
|
||||||
@@ -43,9 +45,10 @@ export async function createSessionEnd(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const payload = job.data.payload;
|
const payload = job.data.payload;
|
||||||
const eventsInBuffer = await eventBuffer.findMany(
|
const eventsInBuffer: IServiceEvent[] = [];
|
||||||
(item) => item.session_id === payload.sessionId,
|
// const eventsInBuffer = await eventBuffer.findMany(
|
||||||
);
|
// (item) => item.session_id === payload.sessionId,
|
||||||
|
// );
|
||||||
|
|
||||||
let eventsInDb = await getCompleteSession({
|
let eventsInDb = await getCompleteSession({
|
||||||
projectId: payload.projectId,
|
projectId: payload.projectId,
|
||||||
|
|||||||
Reference in New Issue
Block a user