From 4c413616da4e13c1b7364ec0d4e38714ee3db0f4 Mon Sep 17 00:00:00 2001 From: "Johannes J. Schmidt" Date: Tue, 15 Apr 2014 16:25:47 +0200 Subject: [PATCH] (#7) - set changes feed limit default to 0 --- README.md | 8 ++++++-- index.js | 10 +++++----- package.json | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 25c58bb..c29c944 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,12 @@ convert_process_timeout = 60000 ; have a changes feed open to each of them. changes_feed_timeout = 60000 ; Batch size. This limits the batches the workers will take from the changes feed. -; It basically translates to a limit parameter on the changes feed. Default is 100 -limit = 100 +; It basically translates to a limit parameter on the changes feed. Default is 0. +; IMPORTANT NOTE: currently you should leave it at 0 unless other feeds than +; `continuous` are supported by couchmagick, because the feed does not stop +; after `limit` changes has been arrived. +; See https://github.com/jo/couchmagick/issues/7 +limit = 0 ``` Imagemagick Configuration diff --git a/index.js b/index.js index 886813b..e6b81d1 100755 --- a/index.js +++ b/index.js @@ -37,11 +37,11 @@ couchmagick.get({ } // defaults - config.streams = config.streams || 20; - config.concurrency = config.concurrency || 1; - config.limit = config.limit || 100; - config.changes_feed_timeout = config.changes_feed_timeout || 60000; - config.convert_process_timeout = config.convert_process_timeout || 60000; + config.concurrency = config.concurrency && parseInt(config.concurrency, 10) || 1; + config.streams = config.streams && parseInt(config.streams, 10) || 1; + config.limit = config.limit && parseInt(config.limit, 100) || 0; + config.changes_feed_timeout = config.changes_feed_timeout && parseInt(config.changes_feed_timeout, 10) || 10000; + config.convert_process_timeout = config.convert_process_timeout && parseInt(config.convert_process_timeout, 10) || 60000; couchmagick.info('using config ' + JSON.stringify(config).replace(/"password":".*?"/, '"password":"***"')); diff --git a/package.json b/package.json index 8b75123..ed58ce0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "couchmagick", - "version": "1.8.0", + "version": "1.8.1", "description": "Run ImageMagicks `convert` on CouchDB documents.", "main": "index.js", "preferGlobal": true,