Fix error log when loading issues caused by a xorm bug (#7271)

* fix error log when loading issues caused by a xorm bug

* upgrade packages

* fix fmt

* fix Consistency

* fix tests
This commit is contained in:
Lunny Xiao 2019-06-23 23:22:43 +08:00 committed by Lauris BH
parent baefea311f
commit aa7c34cf86
156 changed files with 1854 additions and 1833 deletions

View file

@ -5,9 +5,10 @@
package xorm
import (
"context"
"time"
"github.com/go-xorm/core"
"xorm.io/core"
)
// EngineGroup defines an engine group
@ -74,6 +75,20 @@ func (eg *EngineGroup) Close() error {
return nil
}
// Context returned a group session
func (eg *EngineGroup) Context(ctx context.Context) *Session {
sess := eg.NewSession()
sess.isAutoClose = true
return sess.Context(ctx)
}
// NewSession returned a group session
func (eg *EngineGroup) NewSession() *Session {
sess := eg.Engine.NewSession()
sess.sessionType = groupSession
return sess
}
// Master returns the master engine
func (eg *EngineGroup) Master() *Engine {
return eg.Engine