diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 17:39:07 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 17:39:07 +0200 |
| commit | 7ffc2723ea723e6115bf638b389db7c0ada141eb (patch) | |
| tree | 267f0e35341be99601aed16270544cf0a35be8fe | |
| parent | 6a0a5fafb3f7f3b5c8c8cdefa25fefb4b3e9ddfb (diff) | |
| download | apigrabber-7ffc2723ea723e6115bf638b389db7c0ada141eb.tar.gz apigrabber-7ffc2723ea723e6115bf638b389db7c0ada141eb.zip | |
snakeCaseIfy in processor
| -rw-r--r-- | worker.js | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -5,7 +5,6 @@ var amqp = require("amqplib"), request = require("request-promise"), sleep = require("sleep-promise"), - snakeCaseKeys = require("snakecase-keys"), jsonapi = require("./jsonapi"); var MADGLORY_TOKEN = process.env.MADGLORY_TOKEN, @@ -44,7 +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(snakeCaseKeys(match))), { + new Buffer(JSON.stringify(match)), { persistent: true, type: "match", headers: { @@ -57,7 +56,7 @@ if (MADGLORY_TOKEN == undefined) throw "Need an API token"; await Promise.all(data.included .filter((o) => o.type == "player" || o.type == "team") .map(async (o) => await ch.sendToQueue("process", - new Buffer(JSON.stringify(snakeCaseKeys(o))), { + new Buffer(JSON.stringify(o)), { persistent: true, type: o.type, headers: { |
