fix(pkg/types): use measured values as struct instead interface
This commit is contained in:
@ -29,14 +29,14 @@ func Start(cnf *config.Configuration, cleanCacheInterval time.Duration, compress
|
||||
signal.Notify(interrupt, os.Interrupt, os.Kill, syscall.SIGTERM)
|
||||
|
||||
errorChannel := make(chan error, 0)
|
||||
measuredValuesChannel := make(chan []types.MeasuredValue, 0)
|
||||
measuredValuesChannel := make(chan []*types.MeasuredValue, 0)
|
||||
|
||||
ctx := context.Background()
|
||||
childContext, cancel := context.WithCancel(ctx)
|
||||
|
||||
measuredValuesLogfile := logfile.New(cnf.Device.Logfile)
|
||||
|
||||
measuredValuesCache := make([]types.MeasuredValue, 0)
|
||||
measuredValuesCache := make([]*types.MeasuredValue, 0)
|
||||
|
||||
go sensor.ReadContinuously(childContext, cnf.GetSensors(config.ENABLED), measuredValuesChannel, errorChannel)
|
||||
|
||||
@ -78,7 +78,7 @@ func Start(cnf *config.Configuration, cleanCacheInterval time.Duration, compress
|
||||
cancel()
|
||||
logger.Fatal("Can not save temperatures: %v", err)
|
||||
}
|
||||
measuredValuesCache = make([]types.MeasuredValue, 0)
|
||||
measuredValuesCache = make([]*types.MeasuredValue, 0)
|
||||
|
||||
case measuredValues, _ := <-measuredValuesChannel:
|
||||
measuredValuesCache = append(measuredValuesCache, measuredValues...)
|
||||
|
Reference in New Issue
Block a user