From 0752c51101ced6660e65821a94661db913744aed Mon Sep 17 00:00:00 2001 From: Philipp Matthes Date: Tue, 30 Apr 2024 16:22:32 +0200 Subject: [PATCH] Fix incrementation of observations received by topic --- observations/client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/observations/client.go b/observations/client.go index 5564bae..d094d26 100644 --- a/observations/client.go +++ b/observations/client.go @@ -71,8 +71,7 @@ func processMessage(msg mqtt.Message) { // Increment the number of received messages. val, _ := ObservationsReceivedByTopic.LoadOrStore(dsType.(string), uint64(1)) - ptr := val.(*int64) - atomic.AddInt64(ptr, 1) + ObservationsReceivedByTopic.Store(dsType.(string), val.(uint64)+1) var observation Observation if err := json.Unmarshal(msg.Payload(), &observation); err != nil {