mozilla / chronicle

find everything you've ever found
http://mozillachronicle.tumblr.com/
Mozilla Public License 2.0
16 stars 6 forks source link

Convert convict config durations to durations #327

Open pdehaan opened 9 years ago

pdehaan commented 9 years ago

See https://github.com/mozilla/chronicle/pull/323#discussion_r24465661

It may be nice to convert durations into readable strings. For example, from this:

db_reindex_timeout: {
  doc: 'Timeout for an individual step of the reindexing job.',
  format: 'int',
  default: 30000
},

... to this:

db_reindex_timeout: {
  doc: 'Timeout for an individual step of the reindexing job.',
  format: 'duration',
  default: '30 seconds'
},

This should currently work, but won't work if you try and override+import that duration value from a local.json config file like:

"db_reindex_timeout": "10 seconds"
pdehaan commented 9 years ago

We're currently blocked on https://github.com/mozilla/node-convict/issues/68, which may either be a Convict bug, or a "peter doesn't understand what he's doing" bug.