fix(pkg/daemon): compression and rounding

This commit is contained in:
Markus Pesch 2019-10-11 12:44:04 +02:00
parent 25dd99cd3d
commit afe55b3d33
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
1 changed files with 9 additions and 0 deletions

View File

@ -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 {