Skip to content

Commit

Permalink
support retry times in session pool (#354)
Browse files Browse the repository at this point in the history
* support retry times in session pool

* update
  • Loading branch information
HarrisChu authored Sep 12, 2024
1 parent 530bb43 commit ddc78ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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

0 comments on commit ddc78ec

Please sign in to comment.