Fixed typo

This commit is contained in:
Jan Zípek 2022-08-24 19:32:33 +02:00
parent 009332dccf
commit dddcfa7154
Signed by: kamen
GPG Key ID: A17882625B33AC31
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ func (s *SensorValuesService) GetList(sensor string, from int64, to int64) ([]se
func (s *SensorValuesService) GetLatest(sensor string, to int64) (*sensorValue, error) { func (s *SensorValuesService) GetLatest(sensor string, to int64) (*sensorValue, error) {
var value = sensorValue{} var value = sensorValue{}
row := s.ctx.DB.QueryRow("SELECT timestamp, value FROM sensor_values WHERE sensor = ? timestamp < ? ORDER BY timestamp DESC LIMIT 1", sensor, to) row := s.ctx.DB.QueryRow("SELECT timestamp, value FROM sensor_values WHERE sensor = ? AND timestamp < ? ORDER BY timestamp DESC LIMIT 1", sensor, to)
err := row.Scan(&value.Timestamp, &value.Value) err := row.Scan(&value.Timestamp, &value.Value)
if err != nil { if err != nil {