From 7d085bac26ca372a3c9bd097f7c7214af5fbb408 Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 4 Apr 2017 21:04:41 +0200 Subject: ack each message individually --- worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker.js b/worker.js index b277eca..4fcb0bf 100644 --- a/worker.js +++ b/worker.js @@ -209,11 +209,11 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost", } catch (err) { // this should only happen for deadlocks or non-data related issues 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 analyzer Promise.all(participant_ext_records.map(async (p) => -- cgit v1.3.1