summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {