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:
Hector Sanjuan 2022-01-10 12:31:22 +01:00 committed by GitHub
commit c024fec3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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