Fix db engine (#32351)

Fix #32349
This commit is contained in:
wxiaoguang authored and GitHub committed 2024-10-27 18:48:07 -04:00
1 parent d70af38447
commit a920fcfd91
10 files changed
+172 -74

No files matched your search

+1 -4
View File
@@ -161,10 +161,7 @@ func InitEngine(ctx context.Context) error {
// SetDefaultEngine sets the default engine for db
func SetDefaultEngine(ctx context.Context, eng *xorm.Engine) {
x = eng
DefaultContext = &Context{
Context: ctx,
e: x,
}
DefaultContext = &Context{Context: ctx, engine: x}
}
// UnsetDefaultEngine closes and unsets the default engine