Skip to content

Commit f2c4656

Browse files
author
Kirill
committed
fixed bug with incorrect await while emitting data
1 parent c72db56 commit f2c4656

File tree

4 files changed

+389
-387
lines changed

4 files changed

+389
-387
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.4 (February 03, 2020)
2+
3+
* Fixed bug with incorrect await while emitting data
4+
15
## 1.0.3 (December 24, 2019)
26

37
* Update sailor version to 2.5.4

lib/actions/splitOnJsonata.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ async function processAction(msg, cfg) {
2121
const results = [];
2222
split.forEach((elem) => results.push(elem));
2323
this.logger.info('Splitting the incoming message into %s messages', results.length);
24-
results.forEach(async (result) => {
24+
25+
await Promise.all(results.map(async (result) => {
2526
if (result) {
2627
await this.emit('data', messages.newMessageWithBody(result));
2728
}
28-
});
29+
}));
30+
2931
await this.emit('end');
3032
}
3133

0 commit comments

Comments
 (0)