diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-15 15:18:04 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-15 15:18:04 +0200 |
| commit | 3785ed862accad4c8f8b7e719d86aabb0506e36d (patch) | |
| tree | 400f680ec8829780f38222405d9859c1a3c55caa | |
| parent | e015f836ffe02027974ae536a92a2f958018a80e (diff) | |
| download | apigrabber-3785ed862accad4c8f8b7e719d86aabb0506e36d.tar.gz apigrabber-3785ed862accad4c8f8b7e719d86aabb0506e36d.zip | |
scale apigrabber
| -rw-r--r-- | worker.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -9,7 +9,8 @@ var amqp = require("amqplib"), AdmZip = require("adm-zip"); var MADGLORY_TOKEN = process.env.MADGLORY_TOKEN, - RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost"; + RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost", + GRABBERS = parseInt(process.env.GRABBERS) || 4; if (MADGLORY_TOKEN == undefined) throw "Need an API token"; (async () => { @@ -29,7 +30,7 @@ if (MADGLORY_TOKEN == undefined) throw "Need an API token"; } } - await ch.prefetch(1); + await ch.prefetch(GRABBERS); ch.consume("grab", async (msg) => { let payload = JSON.parse(msg.content.toString()), notify = msg.properties.headers.notify; // where to send progress report |
