aa
This commit is contained in:
@@ -819,10 +819,10 @@ func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs []
|
||||
storeIDs = storeIDs2
|
||||
}
|
||||
}
|
||||
dao.Begin(db)
|
||||
txDB , _ := dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
@@ -835,7 +835,7 @@ func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs []
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(msg, ctx.GetUserName())
|
||||
if err = dao.CreateEntity(db, msg); err != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
return "", err
|
||||
}
|
||||
msgStatusList := make([]*model.MessageStatus, len(storeIDs))
|
||||
@@ -847,12 +847,12 @@ func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs []
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(msgStatus, ctx.GetUserName())
|
||||
if err = dao.CreateEntity(db, msgStatus); err != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
return "", err
|
||||
}
|
||||
msgStatusList[k] = msgStatus
|
||||
}
|
||||
dao.Commit(db)
|
||||
dao.Commit(db, txDB)
|
||||
|
||||
rootTask := tasksch.NewParallelTask("SendStoreMessage", nil, ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
db := dao.GetDB()
|
||||
@@ -920,10 +920,10 @@ func NotifyAdjustOrder(order *model.GoodsOrder) (err error) {
|
||||
|
||||
func SendUserMessage(ctx *jxcontext.Context, title, content string, userIDs []string, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
db := dao.GetDB()
|
||||
dao.Begin(db)
|
||||
txDB , _ := dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
@@ -934,7 +934,7 @@ func SendUserMessage(ctx *jxcontext.Context, title, content string, userIDs []st
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(msg, ctx.GetUserName())
|
||||
if err = dao.CreateEntity(db, msg); err != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
return "", err
|
||||
}
|
||||
msgStatusList := make([]*model.MessageStatus, len(userIDs))
|
||||
@@ -946,12 +946,12 @@ func SendUserMessage(ctx *jxcontext.Context, title, content string, userIDs []st
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(msgStatus, ctx.GetUserName())
|
||||
if err = dao.CreateEntity(db, msgStatus); err != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
return "", err
|
||||
}
|
||||
msgStatusList[k] = msgStatus
|
||||
}
|
||||
dao.Commit(db)
|
||||
dao.Commit(db, txDB)
|
||||
|
||||
rootTask := tasksch.NewParallelTask("SendUserMessage", nil, ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
db := dao.GetDB()
|
||||
|
||||
Reference in New Issue
Block a user