From cf9ebe3e49fd44aa503a6c6b8328451c2b5fec23 Mon Sep 17 00:00:00 2001 From: Jonathan Fung Date: Tue, 18 Jun 2024 11:14:18 -0500 Subject: [PATCH] jay's suggestion on pruning --- protocol/streaming/grpc/grpc_streaming_manager.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/protocol/streaming/grpc/grpc_streaming_manager.go b/protocol/streaming/grpc/grpc_streaming_manager.go index a7d51f8262..0c79b41cef 100644 --- a/protocol/streaming/grpc/grpc_streaming_manager.go +++ b/protocol/streaming/grpc/grpc_streaming_manager.go @@ -171,9 +171,8 @@ func (sm *GrpcStreamingManagerImpl) Subscribe( ), "err", err, ) - sm.Lock() - delete(sm.orderbookSubscriptions, subscription.subscriptionId) - sm.Unlock() + // Break out of the loop, stopping this goroutine. + // The channel will fill up and the main thread will prune the subscription. break } }