Skip to content

Commit

Permalink
fix(migration): log out dropped ids after stream end
Browse files Browse the repository at this point in the history
  • Loading branch information
makelicious committed Oct 8, 2024
1 parent c44afb0 commit fea0749
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/search/src/features/reindex/reindex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export const reindex = async () => {
}
})

const droppedCompositionIds: string[] = []

await client.helpers.bulk(
{
retries: 3,
Expand All @@ -74,20 +76,26 @@ export const reindex = async () => {
}
}),
onDrop(doc) {
console.log('dropping id', doc.document.compositionId)
droppedCompositionIds.push(doc.document.compositionId)
}
},
{
meta: true
}
)

const t2 = performance.now()
logger.info(
`Finished reindexing to ${index} in ${((t2 - t1) / 1000).toFixed(
2
)} seconds`
)

if (droppedCompositionIds.length) {
logger.warn(`Could not index ${droppedCompositionIds.length} document(s)`)
logger.warn(droppedCompositionIds.join(', '))
}

return { index }
}

Expand Down

0 comments on commit fea0749

Please sign in to comment.