- add param isContinueWhenError for SyncStoresSkus.

This commit is contained in:
gazebo
2018-10-27 18:43:52 +08:00
parent 7a93cf745d
commit f7df897bdb
9 changed files with 19 additions and 18 deletions

View File

@@ -74,9 +74,9 @@ var (
}
)
func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, skuIDs []int, isAsync bool) (hint string, err error) {
func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, skuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
userName := ctx.GetUserName()
globals.SugarLogger.Debugf("SyncStoreSkus storeID:%d, skuIDs:%v, userName:%s", storeID, skuIDs, userName)
globals.SugarLogger.Debugf("SyncStoreSkus storeID:%d, skuIDs:%v, isContinueWhenError:%t, userName:%s", storeID, skuIDs, isContinueWhenError, userName)
db := dao.GetDB()
if err = p.SyncLocalStoreCategory(db, storeID, userName); err != nil {
@@ -138,7 +138,7 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
return "", err
}
if err = dao.GetRows(db, &storeSkuInfoList, sql, sqlParams...); err == nil {
task := tasksch.NewParallelTask("SyncStoreSkus skus", nil, userName, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
task := tasksch.NewParallelTask("SyncStoreSkus skus", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), userName, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeSku := batchItemList[0].(*tStoreSkuFullInfo)
updateFields := []string{model.FieldEbaiSyncStatus}
isCreate := false