From b7b7528a0639e0ad4cd1bdac0d021752ddbf0401 Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 4 Apr 2017 11:06:17 +0200 Subject: send notifications for participant stats --- worker.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/worker.js b/worker.js index 585333a..11da36f 100644 --- a/worker.js +++ b/worker.js @@ -202,7 +202,11 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost", await ch.ack(msgs.pop(), true); // ack all messages until the last // notify web - await Promise.all(players.map(async (p) => await ch.publish("amq.topic", "player." + p.name, - new Buffer("stats_update")) )); + await Promise.all([ + Promise.all(players.map(async (p) => await ch.publish("amq.topic", "player." + p.name, + new Buffer("stats_update")) )), + Promise.all(participant_ext_records.map(async (p) => await ch.publish("amq.topic", + "participant." + p.api_id, new Buffer("stats_update")) )) + ]); } })(); -- cgit v1.3.1