From 9bbdcbe27d3634e90d6a496909900f301f1854f0 Mon Sep 17 00:00:00 2001 From: gazebo Date: Sat, 5 Jan 2019 15:32:24 +0800 Subject: [PATCH] - when isContinueWhenError is true, contiune in SyncStoresSkus when error --- business/jxstore/cms/sync.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 1fbdf62dd..e11c281c1 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -315,7 +315,12 @@ func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendo if len(loopMapInfo.StoreMapList) > 1 { loopStoreTask := tasksch.NewSeqTask("SyncStoresSkus相同平台循环门店", ctx.GetUserName(), func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { storeID := loopMapInfo.StoreMapList[step].StoreID - _, err = handler.SyncStoreSkus(ctx, task, storeID, skuIDs, false, isContinueWhenError) + if _, err = handler.SyncStoreSkus(ctx, task, storeID, skuIDs, false, isContinueWhenError); err != nil { + globals.SugarLogger.Debugf("SyncStoresSkus failed1 store:%d failed with error:%v", storeID, err) + if isContinueWhenError { + err = nil + } + } return nil, err }, len(loopMapInfo.StoreMapList)) t.AddChild(loopStoreTask).Run()