diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-02 19:42:13 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-02 19:42:13 +0200 |
| commit | 07ed93257129a73dd10d7aedbc77dacf739e6e77 (patch) | |
| tree | a03d9a6f30adddef90500c45c52bc48042c218ee | |
| parent | b9f7c421c2b05a2bde03d92852bcc9230f6841c7 (diff) | |
| download | apigrabber-07ed93257129a73dd10d7aedbc77dacf739e6e77.tar.gz apigrabber-07ed93257129a73dd10d7aedbc77dacf739e6e77.zip | |
send only matches to processor
| -rw-r--r-- | worker.js | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -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) { |
