From 22d97024178a8f987dff99d6f637e9f0cadde3b6 Mon Sep 17 00:00:00 2001 From: Aidan Macdonald Date: Thu, 12 Aug 2021 07:50:04 +0300 Subject: [PATCH 1/2] Making refresh rate controllable from CLI --- env.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/env.js b/env.js index ce74afb..5c9ab72 100644 --- a/env.js +++ b/env.js @@ -11,6 +11,7 @@ module.exports = function() { .option('--changes-limit [value]', 'number of changes to batch') .option('--postgres-table [value]', 'name of the postgres table to replicate to') .option('-d, --daemon', 'continually replicate between CouchDB and PostgresSQL') + .option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode (default 10 * 60 * 60 * 1000 [ms])') .option('-v, --verbose', 'verbose logging') .action(function(source, target) { couchdbUrl = source; @@ -44,7 +45,7 @@ module.exports = function() { couch2pgDocLimit: program['doc-limit'], couch2pgChangesLimit: program['changes-limit'], continuous: program.daemon, - sleepMs: 10 * 60 * 60 * 1000, + sleepMs: program['sleep'] || 10 * 60 * 60 * 1000, postgresTable: program['postgres-table'] || 'couchdb' }; }; From 82636d4ad5256fa314320684e0313d1218fdb3ae Mon Sep 17 00:00:00 2001 From: Aidan Macdonald <6690599+aidan-plenert-macdonald@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:13:30 +0300 Subject: [PATCH 2/2] Update env.js --- env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env.js b/env.js index 5c9ab72..3cdec7f 100644 --- a/env.js +++ b/env.js @@ -11,7 +11,7 @@ module.exports = function() { .option('--changes-limit [value]', 'number of changes to batch') .option('--postgres-table [value]', 'name of the postgres table to replicate to') .option('-d, --daemon', 'continually replicate between CouchDB and PostgresSQL') - .option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode (default 10 * 60 * 60 * 1000 [ms])') + .option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode (default 10 * 60 * 60 * 1000 [ms] = 10 hrs)') .option('-v, --verbose', 'verbose logging') .action(function(source, target) { couchdbUrl = source;