fix(buffer): tmp lower inserts

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-01-30 22:32:04 +00:00
parent 38a93c0b2f
commit a3f39b95d2

View File

@@ -231,12 +231,13 @@ export class EventBuffer extends RedisBuffer<BufferType> {
} }
protected async insertIntoDB(items: BufferType[]): Promise<void> { protected async insertIntoDB(items: BufferType[]): Promise<void> {
for (const chunk of this.getChunks(items, 1500)) { for (const chunk of this.getChunks(items, 500)) {
await ch.insert({ await ch.insert({
table: TABLE_NAMES.events, table: TABLE_NAMES.events,
values: chunk, values: chunk,
format: 'JSONEachRow', format: 'JSONEachRow',
}); });
await new Promise((resolve) => setTimeout(resolve, 50));
} }
} }