From d06cf8383d9fc0e5dbfa1da3cdc688c890f81776 Mon Sep 17 00:00:00 2001 From: "Johannes J. Schmidt" Date: Wed, 18 Dec 2013 14:56:16 +0100 Subject: [PATCH] Limit and Timeout configurable Closes #1 and #2 --- README.md | 2 ++ index.js | 6 ++++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c8efdf8..ce708db 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ Now CouchDB takes care of the couchmagick process. [couchmagick] user = mein-user ; optional password = secure ; optional +timeout = 10000 ; in ms. Default is 1000 +limit = 1000 ; batch size. Default is 100 ``` Imagemagick Configuration diff --git a/index.js b/index.js index 6095024..883d41e 100755 --- a/index.js +++ b/index.js @@ -21,6 +21,8 @@ var noop = function() {}; couchmagick.get({ address: 'httpd.bind_address', port: 'httpd.port', + limit: pkg.name + '.limit', + timeout: pkg.name + '.timeout', auth: { username: pkg.name + '.username', password: pkg.name + '.password' @@ -42,9 +44,9 @@ couchmagick.get({ }); var options = { - limit: 100, + limit: config.limit || 100, feed: 'continuous', - timeout: 1000 + timeout: config.timeout || 1000 }; function listen(db, next) { diff --git a/package.json b/package.json index 91eb209..4027cc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "couchmagick", - "version": "0.1.2", + "version": "1.1.3", "description": "Run ImageMagicks `convert` on CouchDB documents.", "main": "index.js", "preferGlobal": true,