GrünStromIndex: return rates by copy

This commit is contained in:
andig 2023-01-09 09:19:35 +01:00
parent 0aab56ac75
commit f17f4f15ed

View file

@ -132,5 +132,5 @@ func (t *GrünStromIndex) Unit() string {
func (t *GrünStromIndex) Rates() (api.Rates, error) {
t.mux.Lock()
defer t.mux.Unlock()
return t.data, outdatedError(t.updated, time.Hour)
return append(api.Rates{}, t.data...), outdatedError(t.updated, time.Hour)
}