fix: Maximum call stack size exceeded

Signed-off-by: thinkmo <tryit0714@gmail.com>
This commit is contained in:
thinkmo
2024-04-22 21:45:37 +08:00
parent d26e5a5d45
commit 8c1ab9e791
3 changed files with 11 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-backend-module-incremental-ingestion': patch
---
Fix plugin/incremental-ingestion 'Maximum call stack size exceeded' error when ingest large entities.
@@ -336,11 +336,9 @@ export class IncrementalIngestionDatabaseManager {
.join('ingestions', 'ingestions.id', 'ingestion_marks.ingestion_id')
.where('ingestions.id', previousIngestion.id);
removed.push(
...stale.map(e => {
return { entityRef: e.ref };
}),
);
for (const entityRef of stale) {
removed.push({ entityRef: entityRef.ref });
}
}
return { total, removed };
@@ -322,7 +322,9 @@ export class IncrementalIngestionEngine
}
}
if (doRemoval) {
removed.push(...result.removed);
for (const entityRef of result.removed) {
removed.push(entityRef);
}
}
}