diff --git a/packages/db/src/buffers/event-buffer.ts b/packages/db/src/buffers/event-buffer.ts index d9e5346e..31fc9031 100644 --- a/packages/db/src/buffers/event-buffer.ts +++ b/packages/db/src/buffers/event-buffer.ts @@ -231,12 +231,13 @@ export class EventBuffer extends RedisBuffer { } protected async insertIntoDB(items: BufferType[]): Promise { - for (const chunk of this.getChunks(items, 1500)) { + for (const chunk of this.getChunks(items, 500)) { await ch.insert({ table: TABLE_NAMES.events, values: chunk, format: 'JSONEachRow', }); + await new Promise((resolve) => setTimeout(resolve, 50)); } }