summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,