processes is now called streams

pull/20/head
Johannes J. Schmidt 11 years ago
parent 3dbd6ebbfd
commit 4bbf485f43

@ -26,8 +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
; Number of simultanous streams. Default is 1
streams = 8
; Timeout in ms. Default is 10000
timeout = 1000
; Batch size. Default is 100

@ -28,7 +28,7 @@ couchmagick.get({
},
// Batching
processes: pkg.name + '.processes',
streams: pkg.name + '.streams',
limit: pkg.name + '.limit',
timeout: pkg.name + '.timeout'
}, function(err, config) {
@ -37,13 +37,16 @@ couchmagick.get({
}
// defaults
config.processes = config.processes || 4;
config.streams = config.streams || 4;
config.timeout = config.timeout || 10000;
config.limit = config.limit || 100;
couchmagick.info('using config ' + JSON.stringify(config).replace(/"password":".*?"/, '"password":"***"'));
// TODO: validate config
var couch = url.format({
protocol: 'http',
hostname: config.address,
@ -76,6 +79,9 @@ couchmagick.get({
process.exit(0);
}
// get list of all databases
// TODO: listen to db changes
nano(couch).db.list(function(err, dbs) {
if (err) {
couchmagick.error('Can not get _all_dbs: ' + err.description);
@ -87,6 +93,4 @@ couchmagick.get({
});
}
run();
// TODO: listen to db changes
});

@ -1,6 +1,6 @@
{
"name": "couchmagick",
"version": "1.1.8",
"version": "1.2.0",
"description": "Run ImageMagicks `convert` on CouchDB documents.",
"main": "index.js",
"preferGlobal": true,

Loading…
Cancel
Save