From 63b745460ffc3439f83d18e269ec0d398a85ac88 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 29 Oct 2018 16:25:41 +0800 Subject: [PATCH] - limit the batchsize of CreatePromotionSku to 50. --- business/jxstore/promotion/jd_promotion.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/business/jxstore/promotion/jd_promotion.go b/business/jxstore/promotion/jd_promotion.go index c7daa4750..06a414422 100644 --- a/business/jxstore/promotion/jd_promotion.go +++ b/business/jxstore/promotion/jd_promotion.go @@ -50,6 +50,7 @@ const ( const ( DefaultLimitSkuCount = 100 + MaxPromotionSkuCount = jdapi.MaxPromotionSkuCount / 4 ) type SkuPrice struct { @@ -289,7 +290,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params } else if step == 1 { 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) { + task2 := tasksch.NewParallelTask("CreateJdPromotion CreatePromotionSku", tasksch.NewParallelConfig().SetBatchSize(MaxPromotionSkuCount), userName, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { skus := make([]map[string]interface{}, len(batchItemList)) for k, v := range batchItemList { skus[k] = v.(map[string]interface{})