- limit the batchsize of CreatePromotionSku to 50.
This commit is contained in:
@@ -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{})
|
||||
|
||||
Reference in New Issue
Block a user