Remove global context from db package (#35371)

This commit is contained in:
wxiaoguang authored and GitHub committed 2025-08-28 09:44:02 +00:00
1 parent fb056bf4ed
commit dca1af7cad
2 files changed
+16 -62

No files matched your search

-2
View File
@@ -86,7 +86,6 @@ func InitEngine(ctx context.Context) error {
func SetDefaultEngine(ctx context.Context, eng *xorm.Engine) {
xormEngine = eng
xormEngine.SetDefaultContext(ctx)
xormContext = &xormContextType{Context: ctx, engine: xormEngine}
}
// UnsetDefaultEngine closes and unsets the default engine
@@ -98,7 +97,6 @@ func UnsetDefaultEngine() {
_ = xormEngine.Close()
xormEngine = nil
}
xormContext = nil
}
// InitEngineWithMigration initializes a new xorm.Engine and sets it as the XORM's default context