fix(export): use batch size correctly
This commit is contained in:
parent
40d0f79a84
commit
1bf918aa22
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue