Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/impl/redis/input_pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (r *redisPubSubReader) Read(ctx context.Context) (*service.Message, service
}

select {
case rMsg, open := <-pubsub.Channel():
case rMsg, open := <-pubsub.Channel(redis.WithChannelSize(2000)):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The literal 2000 is a magic number. Per the godev "Magic Numbers" rule, "Name all numeric constants. Every literal number in logic must have a clear meaning through a named constant or variable." Consider extracting this to a package-level constant (e.g. const pubsubChannelBufferSize = 2000) so the rationale (buffer for concurrent writes) is tied to a named symbol.

if !open {
_ = r.disconnect()
return nil, nil, service.ErrEndOfInput
Expand Down
Loading