This commit is contained in:
苏尹岚
2021-03-30 17:39:07 +08:00
parent b9f7d7f53a
commit 0dd7235485
49 changed files with 579 additions and 582 deletions

View File

@@ -65,10 +65,10 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
}
}
if err == nil && (storeKV != nil || storeMapKV != nil) {
dao.Begin(db)
txDB , _ := dao.Begin(db)
defer func() {
if r := recover(); r != nil || err != nil {
dao.Rollback(db)
dao.Rollback(db, txDB)
if r != nil {
panic(r)
}
@@ -106,7 +106,7 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
return err
}
}
dao.Commit(db)
dao.Commit(db, txDB)
}
}
return err