summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--worker.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/worker.js b/worker.js
index b95a12a..e585cc7 100644
--- a/worker.js
+++ b/worker.js
@@ -271,12 +271,17 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => {
if (match_objects.length > 0)
await ch.publish("amq.topic", "global", new Buffer("matches_update"));
// notify follow up services
- if (DOANALYZEMATCH) // TODO
+ if (DOANALYZEMATCH) {
await Promise.each(match_objects, async (msg) => {
+ await ch.publish("amq.topic", m.properties.headers.notify,
+ new Buffer("analyze_pending"));
await ch.sendToQueue(ANALYZE_QUEUE,
- new Buffer(msg.content.id),
- { persistent: true });
+ new Buffer(msg.content.id), {
+ persistent: true,
+ headers: { notify: msg.properties.headers.notify }
+ });
});
+ }
} catch (err) {
if (err instanceof Seq.TimeoutError ||
(err instanceof Seq.DatabaseError && err.errno == 1213)) {