summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-08-23 19:46:50 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-08-23 19:46:50 +0200
commita3c78c9512b96a211ac445b68d5af8922d3fc37a (patch)
treebdb0aeafe9a9fad745ff89bbceb1e2ead6bee7aa
parent1f4bfcca02b5b6006f69f56e9e384d6fdf2d727b (diff)
downloadcruncher-a3c78c9512b96a211ac445b68d5af8922d3fc37a.tar.gz
cruncher-a3c78c9512b96a211ac445b68d5af8922d3fc37a.zip
add crunch_update notification according to header
-rw-r--r--worker.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/worker.js b/worker.js
index ba20ee9..bf6b499 100644
--- a/worker.js
+++ b/worker.js
@@ -193,11 +193,12 @@ ${columnName} = column_create(` +
await Promise.map(msgs, async (m) => await ch.ack(m));
// notify web
- // TODO notify for player too
- await Promise.map(api_ids, async (id) => {
- await ch.publish("amq.topic",
- "crunch." + id,
- new Buffer("points_update"));
+ await Promise.map(msgs, async (m) => {
+ if (m.properties.headers.notify)
+ await ch.publish("amq.topic",
+ m.properties.headers.notify,
+ new Buffer("crunch_update")
+ );
});
}