summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-04 21:02:58 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-04 21:02:58 +0200
commit78f4b0cc54f1a877f4e53f1a21b01f8c2791c9d1 (patch)
tree0a04bb0323701fe91b7a3848303d0dae0887824a /worker.js
parent8d3df83e75cc7638ead0c5231faa67d0b9a7b590 (diff)
downloadshrinker-78f4b0cc54f1a877f4e53f1a21b01f8c2791c9d1.tar.gz
shrinker-78f4b0cc54f1a877f4e53f1a21b01f8c2791c9d1.zip
ack each message individually
Diffstat (limited to 'worker.js')
-rw-r--r--worker.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/worker.js b/worker.js
index b65bb59..1772db6 100644
--- a/worker.js
+++ b/worker.js
@@ -250,12 +250,12 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI,
// TODO: eliminate such cases earlier in the chain
// and immediately NACK those broken matches, requeueing only the rest
console.error(err);
- await ch.nack(msgs.pop(), true, true); // nack all messages until the last and requeue
+ await Promise.all(msgs.map((m) => ch.nack(m, true)) ); // requeue
return; // give up
}
console.log("acking batch");
- await ch.ack(msgs.pop(), true); // ack all messages until the last
+ await Promise.all(msgs.map((m) => ch.ack(m)) );
// notify compiler
await Promise.all([