mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-17 14:00:01 +02:00
Rename db Engines related functions (#17481)
* Rename db Engines related functions Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
76a3190b8a
commit
63c0dc89ef
14 changed files with 31 additions and 31 deletions
|
@ -84,9 +84,9 @@ func removeAllWithRetry(dir string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// SetEngine sets the xorm.Engine
|
||||
func SetEngine() (*xorm.Engine, error) {
|
||||
x, err := db.GetNewEngine()
|
||||
// newEngine sets the xorm.Engine
|
||||
func newEngine() (*xorm.Engine, error) {
|
||||
x, err := db.NewEngine()
|
||||
if err != nil {
|
||||
return x, fmt.Errorf("Failed to connect to database: %v", err)
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ func prepareTestEnv(t *testing.T, skip int, syncModels ...interface{}) (*xorm.En
|
|||
return nil, deferFn
|
||||
}
|
||||
|
||||
x, err := SetEngine()
|
||||
x, err := newEngine()
|
||||
assert.NoError(t, err)
|
||||
if x != nil {
|
||||
oldDefer := deferFn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue