1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Upgrade xorm to v1.1.0 (#15869)

This commit is contained in:
Lunny Xiao
2021-05-15 03:17:06 +08:00
committed by GitHub
parent e2f39c2b64
commit f6be429781
55 changed files with 1309 additions and 438 deletions

11
vendor/xorm.io/xorm/engine_group.go generated vendored
View File

@@ -79,7 +79,7 @@ func (eg *EngineGroup) Close() error {
return nil
}
// ContextHook returned a group session
// Context returned a group session
func (eg *EngineGroup) Context(ctx context.Context) *Session {
sess := eg.NewSession()
sess.isAutoClose = true
@@ -144,6 +144,7 @@ func (eg *EngineGroup) SetLogger(logger interface{}) {
}
}
// AddHook adds Hook
func (eg *EngineGroup) AddHook(hook contexts.Hook) {
eg.Engine.AddHook(hook)
for i := 0; i < len(eg.slaves); i++ {
@@ -167,6 +168,14 @@ func (eg *EngineGroup) SetMapper(mapper names.Mapper) {
}
}
// SetTagIdentifier set the tag identifier
func (eg *EngineGroup) SetTagIdentifier(tagIdentifier string) {
eg.Engine.SetTagIdentifier(tagIdentifier)
for i := 0; i < len(eg.slaves); i++ {
eg.slaves[i].SetTagIdentifier(tagIdentifier)
}
}
// SetMaxIdleConns set the max idle connections on pool, default is 2
func (eg *EngineGroup) SetMaxIdleConns(conns int) {
eg.Engine.DB().SetMaxIdleConns(conns)