forked from mystiq/dex
commit
53897e831d
1 changed files with 7 additions and 0 deletions
|
@ -308,6 +308,13 @@ func (s *MySQL) open(logger log.Logger) (*conn, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.MaxIdleConns == 0 {
|
||||||
|
/*Override default behaviour to fix https://github.com/dexidp/dex/issues/1608*/
|
||||||
|
db.SetMaxIdleConns(0)
|
||||||
|
} else {
|
||||||
|
db.SetMaxIdleConns(s.MaxIdleConns)
|
||||||
|
}
|
||||||
|
|
||||||
err = db.Ping()
|
err = db.Ping()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if mysqlErr, ok := err.(*mysql.MySQLError); ok && mysqlErr.Number == mysqlErrUnknownSysVar {
|
if mysqlErr, ok := err.(*mysql.MySQLError); ok && mysqlErr.Number == mysqlErrUnknownSysVar {
|
||||||
|
|
Loading…
Reference in a new issue