From 07ed93257129a73dd10d7aedbc77dacf739e6e77 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 2 Apr 2017 19:42:13 +0200 Subject: send only matches to processor --- worker.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/worker.js b/worker.js index 32379e9..44e85c5 100644 --- a/worker.js +++ b/worker.js @@ -43,26 +43,7 @@ if (MADGLORY_TOKEN == undefined) throw "Need an API token"; // send match structure await Promise.all(matches .map(async (match) => await ch.sendToQueue("process", - new Buffer(JSON.stringify(match)), { - persistent: true, - type: "match", - headers: { - shard: payload.region - } - }) - )); - // send players they are duplicated in the above structure - // and will be inserted seperately - await Promise.all(data.included - .filter((o) => o.type == "player") - .map(async (o) => await ch.sendToQueue("process", - new Buffer(JSON.stringify(o)), { - persistent: true, - type: o.type, - headers: { - shard: payload.region - } - }) + new Buffer(JSON.stringify(match)), { persistent: true }) )); if (matches.length < 50) exhausted = true; } catch (err) { -- cgit v1.3.1