Skip to content

Commit

Permalink
Unsubscribe from waku relay broadcaster
Browse files Browse the repository at this point in the history
  • Loading branch information
snormore committed Sep 12, 2023
1 parent 5ec6565 commit a8b7c19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit a8b7c19

Please sign in to comment.