diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-09 18:22:17 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-09 18:22:17 +0200 |
| commit | e00120259fb2eb637ec1dd7531a8a69394a8ef86 (patch) | |
| tree | 3fa3887eafa17d51c1ed5465c9f094f8c2c66587 /worker.js | |
| parent | aff563f77d7a6533ada36757e77879a0b996e32d (diff) | |
| download | processor-e00120259fb2eb637ec1dd7531a8a69394a8ef86.tar.gz processor-e00120259fb2eb637ec1dd7531a8a69394a8ef86.zip | |
notify cruncher
Diffstat (limited to 'worker.js')
| -rw-r--r-- | worker.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -23,6 +23,7 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI, rabbit = await amqp.connect(RABBITMQ_URI); ch = await rabbit.createChannel(); await ch.assertQueue("process", {durable: true}); + await ch.assertQueue("crunch", {durable: true}); await ch.assertQueue("analyze", {durable: true}); break; } catch (err) { @@ -318,13 +319,19 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI, if (match_records.length > 0) await ch.publish("amq.topic", "global", new Buffer("matches_update")); - // notify analyzer + // notify analyzer & cruncher Promise.all(participant_stats_records.map(async (p) => await ch.sendToQueue("analyze", new Buffer(p.participant_api_id), { persistent: true, type: "participant" }) )); + Promise.all(player_records.map(async (p) => + await ch.sendToQueue("crunch", new Buffer(p.api_id), { + persistent: true, + type: "player" + }) + )); } // Split participant API data into participant and participant_stats |
