Do not try to commit empty array of entity records
Signed-off-by: Damon Kaswell <damon.kaswell1@hp.com>
This commit is contained in:
+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