Skip to content
Merged
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
17 changes: 11 additions & 6 deletions services/apps/data_sink_worker/src/service/dataSink.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,18 @@ export default class DataSinkService extends LoggerBase {
const batch: { resultId: string; data: IResultData | undefined; created: boolean }[] = []
for (const result of resultsToProcess) {
const filtered = resultsToProcess.filter((r) => r.resultId === result.resultId)
if (filtered.length > 1) {
this.log.warn(
{ resultId: result.resultId },
'Found multiple results for the same result id!',
)

// check if we already have this result in the batch
if (!batch.some((b) => b.resultId === filtered[0].resultId)) {
if (filtered.length > 1) {
this.log.warn(
{ resultId: result.resultId },
'Found multiple results for the same result id!',
)
}

batch.push(filtered[0])
}
batch.push(filtered[0])
}

this.log.trace(`[RESULTS] Processing ${batch.length} results!`)
Expand Down
Loading