mirror of
https://github.com/steinhobelgruen/netatmo-exporter.git
synced 2024-11-22 01:13:56 +00:00
Increase default stale duration
This commit is contained in:
parent
b794963127
commit
d86981f7bf
|
@ -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 {
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
Loading…
Reference in a new issue