1
0
mirror of https://gitcode.com/gitea/gitea.git synced 2025-07-09 22:55:51 +08:00

Fix db engine ()

Fix 
This commit is contained in:
wxiaoguang
2024-10-28 06:48:07 +08:00
committed by GitHub
parent d70af38447
commit a920fcfd91
10 changed files with 172 additions and 74 deletions
models
services/packages
tests/integration

@ -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