Skip to content

Commit 2af4f83

Browse files
authored
fix possible discrepancy in possible attachment publish and emitting message (#73)
* Minor asynchronicity improvement
1 parent 2ce8bcf commit 2af4f83

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.4 (August 21, 2020)
2+
3+
Minor asynchronicity improvement.
4+
15
## 2.1.3 (June 5, 2020)
26

37
* Fix `timeout is not a function` bug

component.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
"properties": {
166166
"inputArray": {
167167
"type": "array",
168+
"required": true,
168169
"items": {}
169170
}
170171
}

lib/actions/writeFromArray.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ async function init(cfg) {
5656
ax = axios.create();
5757
util.addRetryCountInterceptorToAxios(ax);
5858
}
59+
5960
async function ProcessAction(msg) {
6061
// eslint-disable-next-line consistent-this
6162
const self = this;
@@ -94,14 +95,15 @@ async function ProcessAction(msg) {
9495
throw Error(`Inbound message should be a plain Object. At least one of entries is not a primitive type: ${JSON.stringify(errorValue)}`);
9596
}
9697

97-
ax.put(putUrl, stringifier, {
98+
await stringifier.end();
99+
100+
await ax.put(putUrl, stringifier, {
98101
method: 'PUT',
99102
timeout: REQUEST_TIMEOUT,
100103
retry: REQUEST_MAX_RETRY,
101104
delay: REQUEST_RETRY_DELAY,
102105
maxContentLength: REQUEST_MAX_CONTENT_LENGTH,
103106
});
104-
stringifier.end();
105107

106108
const messageToEmit = messages.newMessageWithBody({
107109
rowCount,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "csv-component",
3-
"version": "2.1.3",
3+
"version": "2.1.4",
44
"description": "CSV Component for elastic.io platform",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)