From 83869543b136609f9ae9ff3b1e0601610f9f5462 Mon Sep 17 00:00:00 2001 From: Gonzalo-Avalos-Ribas Date: Wed, 28 Aug 2024 09:19:22 -0300 Subject: [PATCH] Duplicated key for the user. Remove metadata from incidents --- src/constants.ts | 3 +++ src/steps/index.ts | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 0c00171..7e16003 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -39,6 +39,9 @@ export const Entities = { _type: 'service_now_incident', _class: 'Incident', disableClassMatch: true, + indexMetadata: { + enabled: false, + }, }, CMDB_OBJECT: { resourceName: 'CMDB Object', diff --git a/src/steps/index.ts b/src/steps/index.ts index ea249d3..c816dfa 100644 --- a/src/steps/index.ts +++ b/src/steps/index.ts @@ -47,7 +47,11 @@ export async function fetchUsers( return; } await client.iterateUsers(async (user) => { - const userEntity = await jobState.addEntity(createUserEntity(user)); + const userEntity = createUserEntity(user); + if (jobState.hasKey(userEntity._key)) { + return; + } + await jobState.addEntity(userEntity); await jobState.addRelationship( createDirectRelationship({