fix(server): library import batch size (#27595)

* lower batch size

* update test
This commit is contained in:
Mert
2026-04-07 15:58:03 -04:00
committed by GitHub
parent 9ba9a22c40
commit 2903b2653b
4 changed files with 14 additions and 17 deletions
+1 -7
View File
@@ -266,13 +266,7 @@ export class LibraryService extends BaseService {
),
);
const assetIds: string[] = [];
for (let i = 0; i < assetImports.length; i += 5000) {
// Chunk the imports to avoid the postgres limit of max parameters at once
const chunk = assetImports.slice(i, i + 5000);
await this.assetRepository.createAll(chunk).then((assets) => assetIds.push(...assets.map((asset) => asset.id)));
}
const assetIds = await this.assetRepository.createAll(assetImports);
const progressMessage =
job.progressCounter && job.totalAssets