mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47:54 +00:00
Fix broken build (#4212)
90e3ad2 broke the build. This fixes the syntax and ensures compilation.
I have no idea and make no claims that this is the correct behavior.
This commit is contained in:
committed by
Chris Hoffman
parent
5b42a8fc67
commit
9b341ed3bc
@@ -71,10 +71,10 @@ func NewMySQLBackend(conf map[string]string, logger log.Logger) (physical.Backen
|
|||||||
}
|
}
|
||||||
dbTable := database + "." + table
|
dbTable := database + "." + table
|
||||||
|
|
||||||
maxIdleConnStr, ok := conf["max_idle_connections"]
|
maxIdleConnStr, ok := conf["max_idle_connections"]
|
||||||
var maxIdleConnInt int = nil
|
var maxIdleConnInt int
|
||||||
if ok {
|
if ok {
|
||||||
maxParmaxIdleConnInt, err = strconv.Atoi(maxIdleConnStr)
|
maxIdleConnInt, err = strconv.Atoi(maxIdleConnStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errwrap.Wrapf("failed parsing max_idle_connections parameter: {{err}}", err)
|
return nil, errwrap.Wrapf("failed parsing max_idle_connections parameter: {{err}}", err)
|
||||||
}
|
}
|
||||||
@@ -83,8 +83,8 @@ func NewMySQLBackend(conf map[string]string, logger log.Logger) (physical.Backen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
maxConnLifeStr, ok := conf["max_connection_lifetime"]
|
maxConnLifeStr, ok := conf["max_connection_lifetime"]
|
||||||
var maxConnLifeInt int = nil
|
var maxConnLifeInt int
|
||||||
if ok {
|
if ok {
|
||||||
maxConnLifeInt, err = strconv.Atoi(maxConnLifeStr)
|
maxConnLifeInt, err = strconv.Atoi(maxConnLifeStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -126,11 +126,11 @@ func NewMySQLBackend(conf map[string]string, logger log.Logger) (physical.Backen
|
|||||||
return nil, fmt.Errorf("failed to connect to mysql: %v", err)
|
return nil, fmt.Errorf("failed to connect to mysql: %v", err)
|
||||||
}
|
}
|
||||||
db.SetMaxOpenConns(maxParInt)
|
db.SetMaxOpenConns(maxParInt)
|
||||||
if maxIdleConnInt != nil {
|
if maxIdleConnInt != 0 {
|
||||||
db.SetMaxIdleConns(maxIdleConnInt)
|
db.SetMaxIdleConns(maxIdleConnInt)
|
||||||
}
|
}
|
||||||
if maxConnLifeInt != nil {
|
if maxConnLifeInt != 0 {
|
||||||
db.SetConnMaxLifetime(time.Second * maxConnLifeInt)
|
db.SetConnMaxLifetime(time.Duration(maxConnLifeInt) * time.Second)
|
||||||
}
|
}
|
||||||
// Check schema exists
|
// Check schema exists
|
||||||
var schemaExist bool
|
var schemaExist bool
|
||||||
|
|||||||
Reference in New Issue
Block a user