Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support retry times in session pool #354

Merged
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ lint:
@test -z `gofmt -l *.go` || (echo "Please run 'make fmt' to format Go code" && exit 1)

up:
cd ./nebula-docker-compose && docker-compose up -d
cd ./nebula-docker-compose && docker compose up -d

up-ssl:
cd ./nebula-docker-compose && enable_ssl=true docker-compose -f docker-compose-ssl.yaml up -d
cd ./nebula-docker-compose && enable_ssl=true docker compose -f docker-compose-ssl.yaml up -d

down:
cd ./nebula-docker-compose && docker-compose down -v
cd ./nebula-docker-compose && docker compose down -v

ssl-test:
ssl_test=true go test -v --tags=integration -run TestSslConnection;
Expand Down
8 changes: 8 additions & 0 deletions configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ func WithHandshakeKey(handshakeKey string) SessionPoolConfOption {
conf.handshakeKey = handshakeKey
}
}
func WithRetryTimes(retryTimes int) SessionPoolConfOption {
if retryTimes < 0 {
retryTimes = 0
}
return func(conf *SessionPoolConf) {
conf.retryGetSessionTimes = retryTimes
}
}

func (conf *SessionPoolConf) checkMandatoryFields() error {
// Check mandatory fields
Expand Down
Loading