Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Duplicated key for the user. Remove metadata from incidents #64

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export const Entities = {
_type: 'service_now_incident',
_class: 'Incident',
disableClassMatch: true,
indexMetadata: {
enabled: false,
},
},
CMDB_OBJECT: {
resourceName: 'CMDB Object',
Expand Down
6 changes: 5 additions & 1 deletion src/steps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Loading