File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -18,20 +18,22 @@ async function processAction(msg, cfg) {
18
18
}
19
19
this . logger . info ( 'Evaluation completed' ) ;
20
20
if ( result === undefined || result === null || Object . keys ( result ) . length === 0 ) {
21
+ this . logger . info ( 'Result from evaluation is empty object or null or undefined, no message will be send to the next step' ) ;
21
22
return Promise . resolve ( ) ;
22
23
}
23
24
24
25
if ( typeof result [ Symbol . iterator ] === 'function' ) {
25
26
// We have an iterator as result
26
27
// eslint-disable-next-line no-restricted-syntax
28
+ this . logger . info ( 'Result from evaluation is an array, each item of the array will be send to the next step as a separate message' ) ;
27
29
for ( const item of result ) {
28
30
// eslint-disable-next-line no-await-in-loop
29
31
await this . emit ( 'data' , eioUtils . newMessageWithBody ( item ) ) ;
30
32
}
31
33
32
34
return Promise . resolve ( ) ;
33
35
}
34
-
36
+ this . logger . info ( '1 message will be send to the next step' ) ;
35
37
return Promise . resolve ( eioUtils . newMessageWithBody ( result ) ) ;
36
38
}
37
39
You can’t perform that action at this time.
0 commit comments