From 301b845c4464b37add7721df6b222cd7220e5db6 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 26 Oct 2018 15:01:15 +0800 Subject: [PATCH] - fix return bug in CreateJdPromotion --- business/jxstore/promotion/jd_promotion.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/business/jxstore/promotion/jd_promotion.go b/business/jxstore/promotion/jd_promotion.go index 287919b9b..c7daa4750 100644 --- a/business/jxstore/promotion/jd_promotion.go +++ b/business/jxstore/promotion/jd_promotion.go @@ -285,13 +285,9 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params return nil, nil }, jxStoreIDs) task.AddChild(task1).Run() - if _, err = task1.GetResult(0); err != nil { - return "", err - } + _, err = task1.GetResult(0) } else if step == 1 { - if err = promotionHandler.CreatePromotionRules(infoId, "", 1, 1, 1, 1); err != nil { - return "", err - } + err = promotionHandler.CreatePromotionRules(infoId, "", 1, 1, 1, 1) } else if step == 2 { task2 := tasksch.NewParallelTask("CreateJdPromotion CreatePromotionSku", tasksch.NewParallelConfig().SetBatchSize(jdapi.MaxPromotionSkuCount), userName, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { skus := make([]map[string]interface{}, len(batchItemList)) @@ -302,9 +298,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params return nil, err }, promotionPrices) task.AddChild(task2).Run() - if _, err = task2.GetResult(0); err != nil { - return "", err - } + _, err = task2.GetResult(0) } else if step == 3 { err = promotionHandler.ConfirmPromotion(infoId, "") }