Merge pull request #24439 from ThinkMo/fix/incremental-ingestion

fix: Maximum call stack size exceeded
This commit is contained in:
Fredrik Adelöw
2024-04-23 15:44:46 +02:00
committed by GitHub
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);
}
}
}