Merge pull request #15665 from dekoding/dekoding/bugfix-no-empty-entities-array
fix(incremental): do not try to commit empty array of entity records
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch
|
||||
---
|
||||
|
||||
Fixed issue with sometimes trying to commit an empty array of references
|
||||
+9
-7
@@ -577,13 +577,15 @@ export class IncrementalIngestionDatabaseManager {
|
||||
.update('ingestion_mark_id', markId)
|
||||
.whereIn('ref', existingRefsArray);
|
||||
|
||||
await tx('ingestion_mark_entities').insert(
|
||||
newRefs.map(ref => ({
|
||||
id: v4(),
|
||||
ingestion_mark_id: markId,
|
||||
ref,
|
||||
})),
|
||||
);
|
||||
if (newRefs.length > 0) {
|
||||
await tx('ingestion_mark_entities').insert(
|
||||
newRefs.map(ref => ({
|
||||
id: v4(),
|
||||
ingestion_mark_id: markId,
|
||||
ref,
|
||||
})),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user