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