From 25f17b7dd65b46693b3456ffff19fd1df2073578 Mon Sep 17 00:00:00 2001 From: sberk42 Date: Sat, 27 Mar 2021 21:16:20 +0100 Subject: [PATCH] fix lua not collected after fritzbox restart --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 1595420..ae017ef 100644 --- a/main.go +++ b/main.go @@ -462,6 +462,7 @@ func (fc *FritzboxCollector) collectLua(ch chan<- prometheus.Metric, dupCache ma if err != nil { fmt.Printf("Error loading %s for %s.%s: %s\n", lm.Path, lm.ResultPath, lm.ResultKey, err.Error()) luaCollectErrors.Inc() + fc.LuaSession.SID = "" // clear SID in case of error, so force reauthentication continue } @@ -485,6 +486,7 @@ func (fc *FritzboxCollector) collectLua(ch chan<- prometheus.Metric, dupCache ma if err != nil { fmt.Printf("Error getting metric values for %s.%s: %s\n", lm.ResultPath, lm.ResultKey, err.Error()) luaCollectErrors.Inc() + cacheEntry.Result = nil // don't use invalid results for cache continue }