Skip to content

Commit

Permalink
pubsub flow limiter is at least 1
Browse files Browse the repository at this point in the history
  • Loading branch information
aratz-lasa committed Jul 29, 2022
1 parent 67c1d8d commit dfa2aed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/vat/cap/pubsub/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ func (t *refCountedTopic) subscribe(args api.Topic_subscribe_Params) (s subscrip

if s.sub, err = t.topic.Subscribe(pubsub.WithBufferSize(int(subOpts.BufferSize()))); err == nil {
s.ch = channel.Sender(args.Chan().AddRef())
s.ch.Client.SetFlowLimiter(newFlowLimiter(subOpts.BufferSize()))
if subOpts.BufferSize() < 1 {
s.ch.Client.SetFlowLimiter(newFlowLimiter(1)) // limiter must be at least 1
} else {
s.ch.Client.SetFlowLimiter(newFlowLimiter(subOpts.BufferSize()))
}

t.ref++
s.t = t
Expand Down

0 comments on commit dfa2aed

Please sign in to comment.