- SyncStoreSkus中加入SyncStoreCategory
This commit is contained in:
@@ -194,6 +194,11 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
if len(skuIDs) == 0 {
|
||||||
|
if _, err = p.SyncStoreCategory(ctx, parentTask, storeID, false); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
return p.syncStoreSkus(ctx, parentTask, storeDetail, skuIDs, isAsync, isContinueWhenError)
|
return p.syncStoreSkus(ctx, parentTask, storeDetail, skuIDs, isAsync, isContinueWhenError)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,9 +230,6 @@ func (p *PurchaseHandler) syncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
|||||||
globals.SugarLogger.Infof("SyncStoreSkus 不能创建商品所需的类别, storeID:%d, skuIDs:%v, isContinueWhenError:%t, userName:%s", storeID, skuIDs, isContinueWhenError, userName)
|
globals.SugarLogger.Infof("SyncStoreSkus 不能创建商品所需的类别, storeID:%d, skuIDs:%v, isContinueWhenError:%t, userName:%s", storeID, skuIDs, isContinueWhenError, userName)
|
||||||
return nil, errors.New("不能创建商品所需的类别")
|
return nil, errors.New("不能创建商品所需的类别")
|
||||||
}
|
}
|
||||||
if _, err = p.SyncStoreCategory(ctx, parentTask, storeID, false); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
} else if step == 1 {
|
} else if step == 1 {
|
||||||
task := tasksch.NewParallelTask("SyncStoreSkus饿百2", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx,
|
task := tasksch.NewParallelTask("SyncStoreSkus饿百2", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user