fix(export): use batch size correctly

This commit is contained in:
Ashhhleyyy 2022-08-06 23:52:18 +01:00
parent 40d0f79a84
commit 1bf918aa22
Signed by: ash
GPG key ID: 83B789081A0878FB

View file

@ -29,8 +29,8 @@ import { prisma } from './db';
const batchSize = 100;
for (let i = 0; i < Math.ceil(pages.length / batchSize); i++) {
const startIndex = i * 100;
const endIndex = Math.min(pages.length, (i + 1) * 100);
const startIndex = i * batchSize;
const endIndex = Math.min(pages.length, (i + 1) * batchSize);
await index.addDocuments(
pages.slice(startIndex, endIndex).map((page) => {
return {