batching events
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
244aa3b0d3
commit
5e225b7ae6
@@ -1,5 +1,6 @@
|
||||
import type { Job } from 'bullmq';
|
||||
|
||||
import { eventBuffer, profileBuffer } from '@openpanel/db';
|
||||
import type { CronQueuePayload } from '@openpanel/queue/src/queues';
|
||||
|
||||
import { salt } from './cron.salt';
|
||||
@@ -9,5 +10,11 @@ export async function cronJob(job: Job<CronQueuePayload>) {
|
||||
case 'salt': {
|
||||
return await salt();
|
||||
}
|
||||
case 'flushEvents': {
|
||||
return await eventBuffer.flush();
|
||||
}
|
||||
case 'flushProfiles': {
|
||||
return await profileBuffer.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user