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{