File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
services/apps/data_sink_worker/src/service Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -253,13 +253,18 @@ export default class DataSinkService extends LoggerBase {
253253 const batch : { resultId : string ; data : IResultData | undefined ; created : boolean } [ ] = [ ]
254254 for ( const result of resultsToProcess ) {
255255 const filtered = resultsToProcess . filter ( ( r ) => r . resultId === result . resultId )
256- if ( filtered . length > 1 ) {
257- this . log . warn (
258- { resultId : result . resultId } ,
259- 'Found multiple results for the same result id!' ,
260- )
256+
257+ // check if we already have this result in the batch
258+ if ( ! batch . some ( ( b ) => b . resultId === filtered [ 0 ] . resultId ) ) {
259+ if ( filtered . length > 1 ) {
260+ this . log . warn (
261+ { resultId : result . resultId } ,
262+ 'Found multiple results for the same result id!' ,
263+ )
264+ }
265+
266+ batch . push ( filtered [ 0 ] )
261267 }
262- batch . push ( filtered [ 0 ] )
263268 }
264269
265270 this . log . trace ( `[RESULTS] Processing ${ batch . length } results!` )
You can’t perform that action at this time.
0 commit comments