|
|
|
@ -28,6 +28,7 @@ couchmagick.get({
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Batching
|
|
|
|
|
concurrency: pkg.name + '.concurrency',
|
|
|
|
|
streams: pkg.name + '.streams',
|
|
|
|
|
limit: pkg.name + '.limit',
|
|
|
|
|
timeout: pkg.name + '.timeout'
|
|
|
|
@ -37,7 +38,8 @@ couchmagick.get({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// defaults
|
|
|
|
|
config.streams = config.streams || 4;
|
|
|
|
|
config.concurrency = config.concurrency || 1;
|
|
|
|
|
config.streams = config.streams || 1;
|
|
|
|
|
config.timeout = config.timeout || 10000;
|
|
|
|
|
config.limit = config.limit || 100;
|
|
|
|
|
|
|
|
|
@ -57,7 +59,8 @@ couchmagick.get({
|
|
|
|
|
var options = {
|
|
|
|
|
limit: config.limit,
|
|
|
|
|
feed: 'continuous',
|
|
|
|
|
timeout: config.timeout
|
|
|
|
|
timeout: config.timeout,
|
|
|
|
|
concurrency: config.concurrency
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -73,6 +76,7 @@ couchmagick.get({
|
|
|
|
|
stream.on('end', next);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// main loop ;)
|
|
|
|
|
function run(err) {
|
|
|
|
|
if (err) {
|
|
|
|
@ -89,7 +93,7 @@ couchmagick.get({
|
|
|
|
|
return process.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async.eachLimit(dbs, config.processes, listen, run);
|
|
|
|
|
async.eachLimit(dbs, config.streams, listen, run);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
run();
|
|
|
|
|