summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-02 19:42:13 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-02 19:42:13 +0200
commit07ed93257129a73dd10d7aedbc77dacf739e6e77 (patch)
treea03d9a6f30adddef90500c45c52bc48042c218ee
parentb9f7c421c2b05a2bde03d92852bcc9230f6841c7 (diff)
downloadapigrabber-07ed93257129a73dd10d7aedbc77dacf739e6e77.tar.gz
apigrabber-07ed93257129a73dd10d7aedbc77dacf739e6e77.zip
send only matches to processor
-rw-r--r--worker.js21
1 files changed, 1 insertions, 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) {