Increase default stale duration

This commit is contained in:
Robert Jacob 2020-07-03 16:47:41 +02:00
parent b794963127
commit d86981f7bf
2 changed files with 3 additions and 1 deletions

View file

@ -126,6 +126,7 @@ type NetatmoCollector struct {
cachedData *netatmo.DeviceCollection cachedData *netatmo.DeviceCollection
} }
// Describe implements prometheus.Collector
func (c *NetatmoCollector) Describe(dChan chan<- *prometheus.Desc) { func (c *NetatmoCollector) Describe(dChan chan<- *prometheus.Desc) {
dChan <- updatedDesc dChan <- updatedDesc
dChan <- tempDesc dChan <- tempDesc
@ -133,6 +134,7 @@ func (c *NetatmoCollector) Describe(dChan chan<- *prometheus.Desc) {
dChan <- cotwoDesc dChan <- cotwoDesc
} }
// Collect implements prometheus.Collector
func (c *NetatmoCollector) Collect(mChan chan<- prometheus.Metric) { func (c *NetatmoCollector) Collect(mChan chan<- prometheus.Metric) {
now := time.Now() now := time.Now()
if now.Sub(c.lastRefresh) >= c.RefreshInterval { if now.Sub(c.lastRefresh) >= c.RefreshInterval {

View file

@ -30,7 +30,7 @@ const (
flagNetatmoPassword = "password" flagNetatmoPassword = "password"
defaultRefreshInterval = 8 * time.Minute defaultRefreshInterval = 8 * time.Minute
defaultStaleDuration = 30 * time.Minute defaultStaleDuration = 60 * time.Minute
) )
var ( var (