Upgrade xorm to v1.0.1 and fix start fail with potgres (#10819)

* upgrade xorm to v1.0.1

* fix start fail with postgres

Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
Lunny Xiao 2020-03-25 22:32:23 +08:00 committed by GitHub
parent b10cb7b258
commit 73f5ca70de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 226 additions and 149 deletions

View file

@ -161,17 +161,17 @@ func (eg *EngineGroup) SetMapper(mapper names.Mapper) {
// SetMaxIdleConns set the max idle connections on pool, default is 2
func (eg *EngineGroup) SetMaxIdleConns(conns int) {
eg.Engine.dialect.DB().SetMaxIdleConns(conns)
eg.Engine.DB().SetMaxIdleConns(conns)
for i := 0; i < len(eg.slaves); i++ {
eg.slaves[i].dialect.DB().SetMaxIdleConns(conns)
eg.slaves[i].DB().SetMaxIdleConns(conns)
}
}
// SetMaxOpenConns is only available for go 1.2+
func (eg *EngineGroup) SetMaxOpenConns(conns int) {
eg.Engine.dialect.DB().SetMaxOpenConns(conns)
eg.Engine.DB().SetMaxOpenConns(conns)
for i := 0; i < len(eg.slaves); i++ {
eg.slaves[i].dialect.DB().SetMaxOpenConns(conns)
eg.slaves[i].DB().SetMaxOpenConns(conns)
}
}