- 修复FormalizeStoreStatus中的死锁问题
This commit is contained in:
@@ -192,15 +192,15 @@ func FormalizeStoreStatus(db *DaoDB, storeID, storeStatus int) (err error) {
|
|||||||
storeID,
|
storeID,
|
||||||
}
|
}
|
||||||
var statusList []int
|
var statusList []int
|
||||||
Begin(db)
|
|
||||||
defer func() {
|
|
||||||
if err != nil {
|
|
||||||
Rollback(db)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
if err = GetRows(db, &statusList, sql, sqlParams...); err == nil {
|
if err = GetRows(db, &statusList, sql, sqlParams...); err == nil {
|
||||||
if len(statusList) == 1 {
|
if len(statusList) == 1 {
|
||||||
if statusList[0] != model.StoreStatusOpened {
|
if statusList[0] != model.StoreStatusOpened {
|
||||||
|
Begin(db)
|
||||||
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
Rollback(db)
|
||||||
|
}
|
||||||
|
}()
|
||||||
if storeStatus != statusList[0] {
|
if storeStatus != statusList[0] {
|
||||||
store := &model.Store{}
|
store := &model.Store{}
|
||||||
store.ID = storeID
|
store.ID = storeID
|
||||||
|
|||||||
Reference in New Issue
Block a user