mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 08:30:54 +00:00
commit
ee615dd08f
@ -374,6 +374,7 @@ func SetMaxIdleConns(aliasName string, maxIdleConns int) {
|
||||
func SetMaxOpenConns(aliasName string, maxOpenConns int) {
|
||||
al := getDbAlias(aliasName)
|
||||
al.MaxOpenConns = maxOpenConns
|
||||
al.DB.DB.SetMaxOpenConns(maxOpenConns)
|
||||
// for tip go 1.2
|
||||
if fun := reflect.ValueOf(al.DB).MethodByName("SetMaxOpenConns"); fun.IsValid() {
|
||||
fun.Call([]reflect.Value{reflect.ValueOf(maxOpenConns)})
|
||||
|
Loading…
Reference in New Issue
Block a user