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