From a700161bfcc59bc1e70fb7318016f56bb03501c7 Mon Sep 17 00:00:00 2001 From: Sebastian Choren Date: Wed, 21 Aug 2024 13:29:20 -0300 Subject: [PATCH] fix(cli): handling of concurrent map read/write --- agent/ui/dashboard/sensors/sensor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/ui/dashboard/sensors/sensor.go b/agent/ui/dashboard/sensors/sensor.go index d39d5f1c97..c4e2637fc1 100644 --- a/agent/ui/dashboard/sensors/sensor.go +++ b/agent/ui/dashboard/sensors/sensor.go @@ -68,7 +68,7 @@ func (r *sensor) On(eventName string, cb func(Event)) { func (r *sensor) Emit(eventName string, event interface{}) { r.mutex.Lock() - r.mutex.Unlock() + defer r.mutex.Unlock() listeners := r.listeners[eventName] e := Event{