From afe55b3d338efb768036d8c62c0fd80e28300df8 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Fri, 11 Oct 2019 12:44:04 +0200 Subject: [PATCH] fix(pkg/daemon): compression and rounding --- pkg/daemon/daemon.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index c3292a8..2c5100d 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -11,6 +11,7 @@ import ( "github.com/go-flucky/flucky/pkg/config" "github.com/go-flucky/flucky/pkg/rgbled" "github.com/go-flucky/flucky/pkg/sensor" + "github.com/go-flucky/flucky/pkg/storage" "github.com/go-flucky/flucky/pkg/storage/db" "github.com/go-flucky/flucky/pkg/storage/logfile" "github.com/go-flucky/flucky/pkg/types" @@ -102,6 +103,14 @@ func Start(cnf *config.Configuration, cleanCacheInterval time.Duration, compress flogger.Error("Can not turn on blue info light: %v", err) } + if round != 0 { + storage.Round(measuredValuesCache, round) + } + + if compression { + measuredValuesCache = storage.Compression(measuredValuesCache) + } + if err := logfile.Append(measuredValuesLogfile, measuredValuesCache); err != nil { err2 := rgbled.Error(rgbLEDs) if err2 != nil {