Unified Storage: Testing For Fix Create, Update and Delete wrt Resource Versions (#88568)
Add testing harness
This commit is contained in:
@@ -44,15 +44,18 @@ type EntityDB struct {
|
||||
}
|
||||
|
||||
func (db *EntityDB) Init() error {
|
||||
_, err := db.GetEngine()
|
||||
return err
|
||||
}
|
||||
|
||||
func (db *EntityDB) GetEngine() (*xorm.Engine, error) {
|
||||
db.once.Do(func() {
|
||||
db.onceErr = db.init()
|
||||
})
|
||||
|
||||
return db.onceErr
|
||||
}
|
||||
|
||||
func (db *EntityDB) GetEngine() (*xorm.Engine, error) {
|
||||
if err := db.Init(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return db.engine, db.onceErr
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user