Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwitt committed Jun 17, 2024
1 parent 0b4c9f7 commit fb5739a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qdone",
"version": "2.0.47-alpha",
"version": "2.0.48-alpha",
"description": "A distributed scheduler for SQS",
"type": "module",
"main": "./index.js",
Expand Down
13 changes: 12 additions & 1 deletion src/enqueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,18 @@ export async function sendMessageBatch (qrl, messages, opt) {
const promises = params.Entries.map(async m => ({ m, shouldEnqueue: await dedupShouldEnqueue(m, opt) }))
const results = await Promise.all(promises)
params.Entries = results.filter(({ shouldEnqueue }) => shouldEnqueue).map(({ m }) => m)
if (!params.Entries.length) return { Failed: [], Successful: [] }
if (!params.Entries.length) {
const result = {

Check warning on line 280 in src/enqueue.js

View check run for this annotation

Codecov / codecov/patch

src/enqueue.js#L280

Added line #L280 was not covered by tests
Failed: [],
Successful: results.map(
({ m: { Id: id, MessageAttributes: ma } }) => ({

Check warning on line 283 in src/enqueue.js

View check run for this annotation

Codecov / codecov/patch

src/enqueue.js#L283

Added line #L283 was not covered by tests
Id: id,
MessageId: 'duplicate',
QdoneDeduplicationId: ma?.QdoneDeduplicationId?.StringValue
}))
}
return result

Check warning on line 289 in src/enqueue.js

View check run for this annotation

Codecov / codecov/patch

src/enqueue.js#L289

Added line #L289 was not covered by tests
}
}

// Send them
Expand Down

0 comments on commit fb5739a

Please sign in to comment.