- tasksch.NewParallelTask2,支持部分失败时得到准备的成功,失败个数信息

This commit is contained in:
gazebo
2019-08-06 14:20:32 +08:00
parent baa9157949
commit c020130819
9 changed files with 68 additions and 48 deletions

View File

@@ -65,12 +65,12 @@ func (p *PurchaseHandler) getStoreSkusBareInfoLimitSize(ctx *jxcontext.Context,
}
func (p *PurchaseHandler) GetStoreSkusBareInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, inStoreSkuList []*partner.StoreSkuInfo) (outStoreSkuList []*partner.StoreSkuInfo, err error) {
result, err := putils.FreeBatchStoreSkuInfo(func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
result, err := putils.FreeBatchStoreSkuInfo(func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
list, err := p.getStoreSkusBareInfoLimitSize(ctx, task, storeID, vendorStoreID, batchedStoreSkuList)
if err == nil {
result = list
}
return result, err
return result, len(list), err
}, ctx, parentTask, inStoreSkuList, jdapi.MaxStoreSkuBatchSize, true)
for _, v := range result {
outStoreSkuList = append(outStoreSkuList, v.(*partner.StoreSkuInfo))