sqs-producer 3.0.0-alpha.2 → 3.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/producer.js +2 -1
- package/package.json +1 -1
- package/src/producer.ts +1 -1
package/dist/producer.js
CHANGED
|
@@ -41,6 +41,7 @@ class Producer {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
async sendBatch(failedMessages, successfulMessages, messages, startIndex) {
|
|
44
|
+
var _a;
|
|
44
45
|
const endIndex = startIndex + this.batchSize;
|
|
45
46
|
const batch = messages.slice(startIndex, endIndex);
|
|
46
47
|
const params = {
|
|
@@ -49,7 +50,7 @@ class Producer {
|
|
|
49
50
|
};
|
|
50
51
|
const command = new client_sqs_1.SendMessageBatchCommand(params);
|
|
51
52
|
const result = await this.sqs.send(command);
|
|
52
|
-
const failedMessagesBatch = failedMessages.concat((result === null || result === void 0 ? void 0 : result.Failed.map((entry) => entry.Id)) || []);
|
|
53
|
+
const failedMessagesBatch = failedMessages.concat(((_a = result === null || result === void 0 ? void 0 : result.Failed) === null || _a === void 0 ? void 0 : _a.map((entry) => entry.Id)) || []);
|
|
53
54
|
const successfulMessagesBatch = successfulMessages.concat((result === null || result === void 0 ? void 0 : result.Successful) || []);
|
|
54
55
|
if (endIndex < messages.length) {
|
|
55
56
|
return this.sendBatch(failedMessagesBatch, successfulMessagesBatch, messages, endIndex);
|
package/package.json
CHANGED
package/src/producer.ts
CHANGED
|
@@ -91,7 +91,7 @@ export class Producer {
|
|
|
91
91
|
const command = new SendMessageBatchCommand(params);
|
|
92
92
|
const result = await this.sqs.send(command);
|
|
93
93
|
const failedMessagesBatch = failedMessages.concat(
|
|
94
|
-
result?.Failed
|
|
94
|
+
result?.Failed?.map((entry) => entry.Id) || []
|
|
95
95
|
);
|
|
96
96
|
const successfulMessagesBatch = successfulMessages.concat(
|
|
97
97
|
result?.Successful || []
|