From f979e88a5224ff5eaeb0c79f4722ac3f8fcda3b4 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Fri, 21 Jun 2019 14:37:02 +0200 Subject: [PATCH] fix(pkg/daemon): turn on red rgb-led if something goes wrong in other cases --- pkg/daemon/daemon.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 741e223..c652965 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -51,8 +51,15 @@ func Start(cnf *config.Configuration, cleanCacheInterval time.Duration, compress for { select { case err, _ := <-errorChannel: + err = rgbled.Red(rgbLEDs) + if err != nil { + logger.Error("Can not turn on red info light: %v", err) + } + logger.Error("%v", err) + time.Sleep(time.Second * 2) + case <-ticker: err := rgbled.Blue(rgbLEDs) if err != nil { @@ -63,6 +70,12 @@ func Start(cnf *config.Configuration, cleanCacheInterval time.Duration, compress err = logfile.AppendTemperatures(temperatureLogfile, compression, temperatureCache) if err != nil { + + err = rgbled.Red(rgbLEDs) + if err != nil { + logger.Error("Can not turn on red info light: %v", err) + } + cancel() logger.Fatal("Can not save temperatures: %v", err) }