From a8b7c19c4e0e2cc648b7aa4956f246a629a5c590 Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Tue, 12 Sep 2023 08:53:30 -0400 Subject: [PATCH] Unsubscribe from waku relay broadcaster --- pkg/server/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/server/server.go b/pkg/server/server.go index ed10e1b3..d01f08b5 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -204,10 +204,12 @@ func New(ctx context.Context, log *zap.Logger, options Options) (*Server, error) if !options.Relay.Disable { for _, nodeTopic := range options.Relay.Topics { nodeTopic := nodeTopic - _, err := s.wakuNode.Relay().SubscribeToTopic(s.ctx, nodeTopic) + sub, err := s.wakuNode.Relay().SubscribeToTopic(s.ctx, nodeTopic) if err != nil { return nil, errors.Wrap(err, "subscribing to pubsub topic") } + // Unregister from broadcaster. Otherwise this channel will fill until it blocks publishing + sub.Unsubscribe() } }