From 3dbd6ebbfd59cf3222455b2c634d2570e513375d Mon Sep 17 00:00:00 2001 From: "Johannes J. Schmidt" Date: Wed, 18 Dec 2013 22:37:48 +0100 Subject: [PATCH] Paralell Changes Feed processing Closes #5 --- README.md | 2 ++ index.js | 4 +++- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eeef279..0eb2591 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Now CouchDB takes care of the couchmagick process. ; Optional username and password username = mein-user password = secure +; Number of simultanous processes. Default is 4 +processes = 8 ; Timeout in ms. Default is 10000 timeout = 1000 ; Batch size. Default is 100 diff --git a/index.js b/index.js index ceea13c..230e1a8 100755 --- a/index.js +++ b/index.js @@ -28,6 +28,7 @@ couchmagick.get({ }, // Batching + processes: pkg.name + '.processes', limit: pkg.name + '.limit', timeout: pkg.name + '.timeout' }, function(err, config) { @@ -36,6 +37,7 @@ couchmagick.get({ } // defaults + config.processes = config.processes || 4; config.timeout = config.timeout || 10000; config.limit = config.limit || 100; @@ -81,7 +83,7 @@ couchmagick.get({ return process.exit(0); } - async.eachSeries(dbs, listen, run); + async.eachLimit(dbs, config.processes, listen, run); }); } run(); diff --git a/package.json b/package.json index c423f2c..840f987 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "couchmagick", - "version": "1.1.7", + "version": "1.1.8", "description": "Run ImageMagicks `convert` on CouchDB documents.", "main": "index.js", "preferGlobal": true,