fixed always loads CacheConfigDefaults bug

- previous code always loaded the cache default
- the time format in cache default should be plain integer
This commit is contained in:
AchMenz
2020-02-28 23:30:18 +01:00
committed by GitHub
parent 776bc492a1
commit fe7da9fcc8

View File

@@ -2,9 +2,8 @@ package config
import (
"time"
"log"
"io/ioutil"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/yaml.v2"
)
@@ -19,13 +18,13 @@ var MQTTConfigDefaults = MQTTConfig{
}
var CacheConfigDefaults = CacheConfig{
Timeout: 2 + time.Minute,
Timeout: 1,
}
type Config struct {
Metrics []MetricConfig `yaml:"metrics"`
MQTT *MQTTConfig `yaml:"mqtt,omitempty"`
Cache *CacheConfig `yaml:"timeout,omitempty"`
Cache *CacheConfig `yaml:"cache,omitempty"`
}
type CacheConfig struct {