diff options
author | Jeremy Brown <jeremy@tenfourty.com> | 2016-08-02 20:48:07 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-08-02 20:48:07 +0300 |
commit | d7f364c27e3adc4e012ee07e71f1c5ad5cfeb56f (patch) | |
tree | e521a284bcf40e9c30fba43c01d2dd621a73a8e4 /commands | |
parent | 5824e80932fd243c429cdae5b15f39402f392673 (diff) |
Fix for meminterval not using specified interval
Hugo seems to ignore the meminterval I specify and always uses it's default of 100ms.
This seems to be because Hugo tries to take the meminterval from the command line
(an Int) and converts it to a String and passes it to time.ParseDuration. If you pass a
different meminterval (such as `1000` as above) it will fail (time.ParseDuration requires
some units) and use the default instead.
Changed `meminterval` to be a String and added better documentation for valid time units.
Resolves: #2325
Diffstat (limited to 'commands')
-rw-r--r-- | commands/server.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/server.go b/commands/server.go index 7294115e3..ffaaf1fd8 100644 --- a/commands/server.go +++ b/commands/server.go @@ -94,7 +94,8 @@ func init() { serverCmd.Flags().BoolVar(&disableLiveReload, "disableLiveReload", false, "watch without enabling live browser reload on rebuild") serverCmd.Flags().BoolVar(&renderToDisk, "renderToDisk", false, "render to Destination path (default is render to memory & serve from there)") serverCmd.Flags().String("memstats", "", "log memory usage to this file") - serverCmd.Flags().Int("meminterval", 100, "interval to poll memory usage (requires --memstats)") + serverCmd.Flags().String("meminterval", "100ms", "interval to poll memory usage (requires --memstats), valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".") + serverCmd.RunE = server mime.AddExtensionType(".json", "application/json; charset=utf-8") |