diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-04 20:30:33 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-04 20:30:33 +0200 |
| commit | de9bd96b5ccda3b9a354cf3e02d49012bdc177d4 (patch) | |
| tree | fb6bbefc594053c06add419cc9a8961af662ca37 | |
| parent | d7fcdb2ee11fa2f5a10f911b6916741ea0672734 (diff) | |
| download | compiler-de9bd96b5ccda3b9a354cf3e02d49012bdc177d4.tar.gz compiler-de9bd96b5ccda3b9a354cf3e02d49012bdc177d4.zip | |
send jobs to compiler
| -rw-r--r-- | worker.js | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -20,6 +20,7 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost", rabbit = await amqp.connect(RABBITMQ_URI), ch = await rabbit.createChannel(); await ch.assertQueue("compile", {durable: true}); + await ch.assertQueue("analyze", {durable: true}); break; } catch (err) { console.error(err); @@ -212,6 +213,14 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost", console.log("acking batch"); await ch.ack(msgs.pop(), true); // ack all messages until the last + // notify analyzer + Promise.all(participant_ext_records.map(async (p) => + await ch.sendToQueue("analyze", new Buffer(p.participant_api_id), { + persistent: true, + type: "participant" + }) + )); + // notify web await Promise.all([ Promise.all(players.map(async (p) => await ch.publish("amq.topic", "player." + p.name, |
