From 6d3cbc4d16e9a41feb9f8528c6c50cc4593590e0 Mon Sep 17 00:00:00 2001 From: Sarat Chandra Date: Thu, 14 Mar 2024 11:39:43 +0530 Subject: [PATCH] fix: Remove unneccesary locking in in-memory broker for sending to work channel. --- brokers/in-memory/broker.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/brokers/in-memory/broker.go b/brokers/in-memory/broker.go index 1ebaabe..2467d07 100644 --- a/brokers/in-memory/broker.go +++ b/brokers/in-memory/broker.go @@ -46,9 +46,7 @@ func (r *Broker) Consume(ctx context.Context, work chan []byte, queue string) { r.pending[queue] = r.pending[queue][1:] r.pmu.Unlock() - r.mu.RLock() work <- d - r.mu.RUnlock() } } }