summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-06-14 12:48:21 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-06-14 12:48:21 +0200
commita89cd6b0bfd53ee7655bfe887f3ebf08067c39aa (patch)
tree4f6a1a2c05db5c65a2eeb6c619471669b1a94b96
parent720c680c0902fcc3a3c56457120416a7893480d9 (diff)
downloadapigrabber-a89cd6b0bfd53ee7655bfe887f3ebf08067c39aa.tar.gz
apigrabber-a89cd6b0bfd53ee7655bfe887f3ebf08067c39aa.zip
send match_pending to player.name
-rw-r--r--worker.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/worker.js b/worker.js
index d6befcb..0c67b84 100644
--- a/worker.js
+++ b/worker.js
@@ -72,13 +72,16 @@ if (LOGGLY_TOKEN)
const data = await Promise.each(await api.requests(where,
payload.region, payload.params, logger),
async (data, idx, len) => {
- if (where == "matches") // send match structure
+ if (where == "matches") { // send match structure
await ch.sendToQueue(PROCESS_QUEUE,
new Buffer(JSON.stringify(data)), {
persistent: true, type: "match",
headers: idx == len - 1? { notify: notify } : {}
});
// forward "notify" for the last match on the last page
+ if (notify) await ch.publish("amq.topic", notify,
+ new Buffer("match_pending"));
+ }
if (where == "samples")
// forward to sampler
await ch.sendToQueue(SAMPLE_QUEUE,