Making refresh rate controllable from CLI#30
Open
aodhan-domhnaill wants to merge 2 commits intomainfrom
Open
Conversation
njogz
approved these changes
Aug 12, 2021
| .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] = 10 hrs)') |
Contributor
There was a problem hiding this comment.
Can we come up with a better name for this parameter? I'm thinking --sleep-interval or --polling-interval or something more descriptive?
Secondly, commander allows setting defaults which would save a little code later on, eg:
Suggested change
| .option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode (default 10 * 60 * 60 * 1000 [ms] = 10 hrs)') | |
| .option('-s, --sleep', 'Sleep interval in milliseconds between runs in daemon mode', 10 * 60 * 60 * 1000) |
There are even more complicated options if you want to parse the variable or provide a human readable default value. More info in their documentation.
garethbowen
suggested changes
Aug 12, 2021
Contributor
garethbowen
left a comment
There was a problem hiding this comment.
Nice addition! I've left a comment inline about parameter naming and using more advanced features of commander.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per #29