summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-08-13 12:36:32 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-08-13 12:36:32 +0200
commit9b67d1072d7764c163a4c8512f576eeb47964d5d (patch)
tree413858120ad2dce693928e01beea7c166d03cf60
parent8fc543cd4773965a231b8b00e80730f5130fedd4 (diff)
downloadprocessor-9b67d1072d7764c163a4c8512f576eeb47964d5d.tar.gz
processor-9b67d1072d7764c163a4c8512f576eeb47964d5d.zip
fix stats_update notification
-rw-r--r--worker.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/worker.js b/worker.js
index f5531d8..281ca1b 100644
--- a/worker.js
+++ b/worker.js
@@ -262,11 +262,9 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => {
// notify web
await Promise.map(msgs, async (m) => {
if (m.properties.headers.notify == undefined) return;
- let notif = "";
switch (m.properties.type) {
// new match
case "match":
- notif = "matches_update";
// notify player.name.api_id about match_update
await Promise.map(match_objects, async (mat) =>
await ch.publish("amq.topic",
@@ -278,7 +276,8 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => {
break;
case "player":
// player obj updated
- notif = "stats_update";
+ await ch.publish("amq.topic", m.properties.headers.notify,
+ new Buffer("stats_update"));
break;
}
});