diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-13 13:38:57 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-13 13:38:57 +0200 |
| commit | f12f22453d03546b01e3cd7399fb1ce62f0cc128 (patch) | |
| tree | 9a0cd2ed45377ab3bcd027523dc8c5f8be691479 | |
| parent | d5e77689203d4337a323810fcfd4221cf54c8b9f (diff) | |
| download | processor-f12f22453d03546b01e3cd7399fb1ce62f0cc128.tar.gz processor-f12f22453d03546b01e3cd7399fb1ce62f0cc128.zip | |
do not send any players to cruncher
| -rw-r--r-- | worker.js | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -12,7 +12,7 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI, DATABASE_URI = process.env.DATABASE_URI, // matches + players (2 pages for 100 players) BATCHSIZE = parseInt(process.env.BATCHSIZE) || 4 * 50 * (1 + 5), - IDLE_TIMEOUT = parseFloat(process.env.IDLE_TIMEOUT) || 1000, // ms + IDLE_TIMEOUT = parseFloat(process.env.IDLE_TIMEOUT) || 2000, // ms PREMIUM_FEATURES = process.env.PREMIUM_FEATURES || false; // calculate on demand for non-premium users console.log("features for premium users activated", PREMIUM_FEATURES); @@ -43,7 +43,6 @@ function snakeCaseKeys(obj) { rabbit = await amqp.connect(RABBITMQ_URI, { heartbeat: 30 }); 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) { @@ -391,21 +390,13 @@ function snakeCaseKeys(obj) { if (match_records.length > 0) await ch.publish("amq.topic", "global", new Buffer("matches_update")); - // notify analyzer & cruncher + // notify analyzer 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_objects.map(async (api_player) => { - if (PREMIUM_FEATURES == false || premium_users.indexOf(api_player.id) != -1) { - await ch.sendToQueue("crunch", new Buffer(api_player.id), { - persistent: true, - type: "player" - }) - } - })); } // Split participant API data into participant and participant_stats |
