DriveSomethingGreater: log unzipped data

This commit is contained in:
andig 2026-06-05 17:43:14 +02:00
parent fe07fa7838
commit da8f13254e
2 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,7 @@
package eudataact
import (
"log"
"maps"
"slices"
"sync"
@ -73,7 +74,7 @@ func (s *store) state(vin string) *vehicleState {
// merged and merges them into the vehicle's map oldest to newest. It returns the
// newest dataset's delivery time (used to schedule the next poll).
// On first poll latest maxBackfill content datasets are downloaded.
func (s *store) update(vin string) (time.Time, error) {
func (s *store) update(log *log.Logger, vin string) (time.Time, error) {
v := s.state(vin)
v.mu.Lock()

View file

@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"io"
"log"
"slices"
"strings"
"time"
@ -144,7 +145,7 @@ func contentDatasets(list []dataset) ([]dataset, error) {
// data field name. On duplicate field names the entry with the newest timestamp
// wins. The VIN is returned so the caller can drop datasets that do not belong
// to the requested vehicle.
func parseDataset(b []byte) (map[string]point, error) {
func parseDataset(log *log.Logger, b []byte) (map[string]point, error) {
zr, err := zip.NewReader(bytes.NewReader(b), int64(len(b)))
if err != nil {
return nil, err
@ -172,6 +173,8 @@ func parseDataset(b []byte) (map[string]point, error) {
return nil, err
}
log.Println(raw)
var ds datasetFile
if err := json.Unmarshal(raw, &ds); err != nil {
return nil, err