- 漏了一个文件
This commit is contained in:
@@ -29,7 +29,7 @@ func (p *DefSingleStorePlatform) DeleteStoreAllSkus(ctx *jxcontext.Context, pare
|
||||
VendorSkuID: v.SkuList[0].VendorSkuID,
|
||||
}
|
||||
}
|
||||
_, err = FreeBatchStoreSkuInfo(func(batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
|
||||
_, err = FreeBatchStoreSkuInfo(func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
|
||||
_, err = p.DeleteStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList)
|
||||
return nil, err
|
||||
}, ctx, parentTask, storeStoreList, p.GetStoreSkusBatchSize(partner.FuncDeleteStoreSkus), isContinueWhenError)
|
||||
@@ -76,7 +76,7 @@ func flatCatList(catList []*partner.BareCategoryInfo) (flattedCatList []*partner
|
||||
}
|
||||
|
||||
func (p *DefSingleStorePlatform) GetStoreSkusBareInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, inStoreSkuList []*partner.StoreSkuInfo) (outStoreSkuList []*partner.StoreSkuInfo, err error) {
|
||||
resultList, err := FreeBatchStoreSkuInfo(func(batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
|
||||
resultList, err := FreeBatchStoreSkuInfo(func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
|
||||
return p.GetStoreSkusFullInfo(ctx, parentTask, storeID, vendorStoreID, batchedStoreSkuList)
|
||||
}, ctx, parentTask, inStoreSkuList, p.GetStoreSkusBatchSize(partner.FuncGetStoreSkusFullInfo), true)
|
||||
if err != nil || len(resultList) == 0 {
|
||||
@@ -133,15 +133,15 @@ func (p *DefSingleStorePlatform) GetStoreCategory(ctx *jxcontext.Context, storeI
|
||||
return cat, err
|
||||
}
|
||||
|
||||
func FreeBatchStoreSkuInfo(handler func([]*partner.StoreSkuInfo) (interface{}, error), ctx *jxcontext.Context, parentTask tasksch.ITask, storeSkuList []*partner.StoreSkuInfo, batchSize int, isContinueWhenError bool) (resultList []interface{}, err error) {
|
||||
func FreeBatchStoreSkuInfo(handler func(tasksch.ITask, []*partner.StoreSkuInfo) (interface{}, error), ctx *jxcontext.Context, parentTask tasksch.ITask, storeSkuList []*partner.StoreSkuInfo, batchSize int, isContinueWhenError bool) (resultList []interface{}, err error) {
|
||||
if len(storeSkuList) > batchSize {
|
||||
task := tasksch.NewParallelTask("FreeBatchStoreSkuInfo", tasksch.NewParallelConfig().SetBatchSize(batchSize).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
task := tasksch.NewParallelTask("FreeBatchStoreSkuInfo", tasksch.NewParallelConfig().SetParallelCount(1).SetBatchSize(batchSize).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
batchStoreSkuList := make([]*partner.StoreSkuInfo, len(batchItemList))
|
||||
for k, v := range batchItemList {
|
||||
batchStoreSkuList[k] = v.(*partner.StoreSkuInfo)
|
||||
}
|
||||
retVal, err = handler(batchStoreSkuList)
|
||||
retVal, err = handler(task, batchStoreSkuList)
|
||||
if err != nil {
|
||||
retVal = nil
|
||||
}
|
||||
@@ -150,7 +150,7 @@ func FreeBatchStoreSkuInfo(handler func([]*partner.StoreSkuInfo) (interface{}, e
|
||||
tasksch.HandleTask(task, parentTask, false).Run()
|
||||
resultList, err = task.GetResult(0)
|
||||
} else {
|
||||
result, err2 := handler(storeSkuList)
|
||||
result, err2 := handler(parentTask, storeSkuList)
|
||||
if err = err2; err == nil {
|
||||
resultList = utils.Interface2Slice(result)
|
||||
}
|
||||
@@ -158,15 +158,15 @@ func FreeBatchStoreSkuInfo(handler func([]*partner.StoreSkuInfo) (interface{}, e
|
||||
return resultList, err
|
||||
}
|
||||
|
||||
func FreeBatchStoreSkuSyncInfo(handler func([]*dao.StoreSkuSyncInfo) (interface{}, error), ctx *jxcontext.Context, parentTask tasksch.ITask, storeSkuList []*dao.StoreSkuSyncInfo, batchSize int, isContinueWhenError bool) (resultList []interface{}, err error) {
|
||||
func FreeBatchStoreSkuSyncInfo(handler func(tasksch.ITask, []*dao.StoreSkuSyncInfo) (interface{}, error), ctx *jxcontext.Context, parentTask tasksch.ITask, storeSkuList []*dao.StoreSkuSyncInfo, batchSize int, isContinueWhenError bool) (resultList []interface{}, err error) {
|
||||
if len(storeSkuList) > batchSize {
|
||||
task := tasksch.NewParallelTask("FreeBatchStoreSkuSyncInfo", tasksch.NewParallelConfig().SetBatchSize(batchSize).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
task := tasksch.NewParallelTask("FreeBatchStoreSkuSyncInfo", tasksch.NewParallelConfig().SetParallelCount(1).SetBatchSize(batchSize).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
batchStoreSkuList := make([]*dao.StoreSkuSyncInfo, len(batchItemList))
|
||||
for k, v := range batchItemList {
|
||||
batchStoreSkuList[k] = v.(*dao.StoreSkuSyncInfo)
|
||||
}
|
||||
retVal, err = handler(batchStoreSkuList)
|
||||
retVal, err = handler(task, batchStoreSkuList)
|
||||
if err != nil {
|
||||
retVal = nil
|
||||
}
|
||||
@@ -175,7 +175,7 @@ func FreeBatchStoreSkuSyncInfo(handler func([]*dao.StoreSkuSyncInfo) (interface{
|
||||
tasksch.HandleTask(task, parentTask, false).Run()
|
||||
resultList, err = task.GetResult(0)
|
||||
} else {
|
||||
result, err2 := handler(storeSkuList)
|
||||
result, err2 := handler(parentTask, storeSkuList)
|
||||
if err = err2; err == nil {
|
||||
resultList = utils.Interface2Slice(result)
|
||||
}
|
||||
@@ -185,7 +185,7 @@ func FreeBatchStoreSkuSyncInfo(handler func([]*dao.StoreSkuSyncInfo) (interface{
|
||||
|
||||
func FreeBatchCategoryIDOp(handler func(vendorCatID string) (err error), ctx *jxcontext.Context, parentTask tasksch.ITask, vendorCatIDs []string, isContinueWhenError bool) (err error) {
|
||||
if len(vendorCatIDs) > 1 {
|
||||
task := tasksch.NewParallelTask("FreeBatchCategoryIDOp", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
task := tasksch.NewParallelTask("FreeBatchCategoryIDOp", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
err = handler(batchItemList[0].(string))
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user