This commit is contained in:
MaysWind
2020-11-08 20:02:59 +08:00
parent 234b5a7465
commit 180ae7cb72
5 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ type Database struct {
*xorm.EngineGroup
}
func (db *Database) DoTranscation(fn func(sess *xorm.Session) error) (err error) {
func (db *Database) DoTransaction(fn func(sess *xorm.Session) error) (err error) {
sess := db.NewSession()
defer sess.Close()
+2 -2
View File
@@ -18,8 +18,8 @@ func (s *DataStore) Query(key int64) *xorm.Session {
return s.Choose(key).NewSession()
}
func (s *DataStore) DoTranscation(key int64, fn func(sess *xorm.Session) error) (err error) {
return s.Choose(key).DoTranscation(fn)
func (s *DataStore) DoTransaction(key int64, fn func(sess *xorm.Session) error) (err error) {
return s.Choose(key).DoTransaction(fn)
}
func (s *DataStore) SyncStructs(beans... interface{}) error {