mirror of
https://github.com/hikhvar/mqtt2prometheus.git
synced 2026-05-18 22:39:24 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user