Skip to content

Commit

Permalink
feature: make couchbase initial connection configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzyildirim committed Mar 26, 2023
1 parent a399095 commit afba135
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ $ go get github.com/Trendyol/go-dcp-client
| `collectionNames` | []string | no | _default |
| `dcp.bufferSizeKb` | int | no | 16384 |
| `dcp.connectionBufferSizeKb` | uint | no | 20480 |
| `dcp.connectionTimeout` | time.Duration | no | 5s |
| `dcp.listener.bufferSize` | int | no | 1 |
| `dcp.group.membership.memberNumber` | int | no | 1 |
| `dcp.group.membership.totalMembers` | int | no | 1 |
Expand Down
2 changes: 1 addition & 1 deletion dcp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (s *client) connect(bucketName string) (*gocbcore.Agent, error) {
ch := make(chan error)

_, err = client.WaitUntilReady(
time.Now().Add(time.Second*5),
time.Now().Add(s.config.Dcp.ConnectionTimeout),
gocbcore.WaitUntilReadyOptions{
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
},
Expand Down
1 change: 1 addition & 0 deletions helpers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type ConfigDCP struct {
Group ConfigDCPGroup `yaml:"group"`
BufferSizeKb int `yaml:"bufferSizeKb" default:"16384"`
ConnectionBufferSizeKb uint `yaml:"connectionBufferSizeKb" default:"20480"`
ConnectionTimeout time.Duration `yaml:"connectionTimeout" default:"5"`
Listener ConfigDCPListener `yaml:"listener"`
}

Expand Down

0 comments on commit afba135

Please sign in to comment.