Merge pull request #1519 from ipfs/min-metric-ttl
Fix: ttl for tags should be default when not provided (now 0).
This commit is contained in:
commit
c024fec3af
|
@ -89,8 +89,13 @@ func (cfg *Config) LoadJSON(raw []byte) error {
|
|||
}
|
||||
|
||||
func (cfg *Config) applyJSONConfig(jcfg *jsonConfig) error {
|
||||
t, _ := time.ParseDuration(jcfg.MetricTTL)
|
||||
cfg.MetricTTL = t
|
||||
err := config.ParseDurations(
|
||||
cfg.ConfigKey(),
|
||||
&config.DurationOpt{Duration: jcfg.MetricTTL, Dst: &cfg.MetricTTL, Name: "metric_ttl"},
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cfg.Tags = jcfg.Tags
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user