summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-07-24 13:22:07 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-07-24 13:22:07 +0200
commit42d77ccc199812f692d10d30a1eda1a81e5f235b (patch)
treeb72342115e4083ebb5833f0edee6ad64007e657c
parentc38b3b80d9d8ee1ebde62905feb79eaa050218c7 (diff)
downloadprocessor-42d77ccc199812f692d10d30a1eda1a81e5f235b.tar.gz
processor-42d77ccc199812f692d10d30a1eda1a81e5f235b.zip
send matches to player cruncher
-rw-r--r--worker.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/worker.js b/worker.js
index 37cc25a..16f7708 100644
--- a/worker.js
+++ b/worker.js
@@ -26,6 +26,8 @@ const RABBITMQ_URI = process.env.RABBITMQ_URI,
MAXCONNS = parseInt(process.env.MAXCONNS) || 10, // how many concurrent actions
DOANALYZEMATCH = process.env.DOANALYZEMATCH == "true",
ANALYZE_QUEUE = process.env.ANALYZE_QUEUE || "analyze",
+ DOCRUNCHMATCH = process.env.DOCRUNCHMATCH == "true",
+ CRUNCH_PLAYER_QUEUE = process.env.CRUNCH_PLAYER_QUEUE || "crunch_player",
LOAD_TIMEOUT = parseFloat(process.env.LOAD_TIMEOUT) || 5000, // ms
IDLE_TIMEOUT = parseFloat(process.env.IDLE_TIMEOUT) || 700; // ms
@@ -275,6 +277,11 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => {
await Promise.each(match_objects, async (m) =>
await ch.sendToQueue(ANALYZE_QUEUE, new Buffer(m.id),
{ persistent: true }));
+ if (DOCRUNCHMATCH) {
+ await Promise.each(match_objects, async (m) =>
+ await ch.sendToQueue(CRUNCH_PLAYER_QUEUE, new Buffer(m.id),
+ { persistent: true }));
+ }
} catch (err) {
if (err instanceof Seq.TimeoutError) {
// deadlocks / timeout