feat(daemon): new flag to set compression
This commit is contained in:
@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// Start the daemon
|
||||
func Start(cnf *config.Configuration) error {
|
||||
func Start(cnf *config.Configuration, compression bool) error {
|
||||
|
||||
interrupt := make(chan os.Signal, 1)
|
||||
signal.Notify(interrupt, os.Interrupt, os.Kill, syscall.SIGTERM)
|
||||
@ -37,7 +37,7 @@ func Start(cnf *config.Configuration) error {
|
||||
log.Printf("Write measured values into logfile")
|
||||
|
||||
log.Printf("%v new measured temperature values", len(temperatures))
|
||||
err := logfile.WriteTemperatures(temperatures, cnf.Device.TemperatureLogfile, true)
|
||||
err := logfile.WriteTemperatures(temperatures, cnf.Device.TemperatureLogfile, compression)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Can not save temperatures: %v", err)
|
||||
}
|
||||
@ -48,7 +48,7 @@ func Start(cnf *config.Configuration) error {
|
||||
temperatures = append(temperatures, temperature)
|
||||
} else {
|
||||
log.Printf("Temperature Channel closed. Write remaining values into the logfile")
|
||||
err := logfile.WriteTemperatures(temperatures, cnf.Device.TemperatureLogfile, true)
|
||||
err := logfile.WriteTemperatures(temperatures, cnf.Device.TemperatureLogfile, compression)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Can not save temperatures: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user