diff --git a/Makefile b/Makefile index 2c38a30f..17855ff1 100644 --- a/Makefile +++ b/Makefile @@ -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; diff --git a/configs.go b/configs.go index f1104dc4..5bacd9e3 100644 --- a/configs.go +++ b/configs.go @@ -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