- SyncStoresSkus2中,当setSyncStatus不为0时,在要处理相应门店时,才设置相应标志(之前是一开始全部设置标志)
This commit is contained in:
@@ -369,9 +369,6 @@ func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, db *dao.DaoDB, vend
|
|||||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||||
if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
|
if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
|
||||||
if setSyncStatus != 0 {
|
|
||||||
dao.SetStoreSkuSyncStatus(db, loopMapInfo.VendorID, storeIDs, skuIDs, setSyncStatus)
|
|
||||||
}
|
|
||||||
parallelCount := 5
|
parallelCount := 5
|
||||||
if model.MultiStoresVendorMap[loopMapInfo.VendorID] == 1 {
|
if model.MultiStoresVendorMap[loopMapInfo.VendorID] == 1 {
|
||||||
parallelCount = 1
|
parallelCount = 1
|
||||||
@@ -380,6 +377,9 @@ func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, db *dao.DaoDB, vend
|
|||||||
tasksch.NewParallelConfig().SetParallelCount(parallelCount).SetIsContinueWhenError(isContinueWhenError), ctx,
|
tasksch.NewParallelConfig().SetParallelCount(parallelCount).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
storeMap := batchItemList[0].(*model.StoreMap)
|
storeMap := batchItemList[0].(*model.StoreMap)
|
||||||
|
if setSyncStatus != 0 {
|
||||||
|
dao.SetStoreSkuSyncStatus(db, storeMap.VendorID, []int{storeMap.StoreID}, skuIDs, setSyncStatus)
|
||||||
|
}
|
||||||
if _, err = v.proxySyncStoreSku(ctx, task, storeMap, nil, skuIDs, excludeSkuIDs, false, isContinueWhenError); err != nil {
|
if _, err = v.proxySyncStoreSku(ctx, task, storeMap, nil, skuIDs, excludeSkuIDs, false, isContinueWhenError); err != nil {
|
||||||
globals.SugarLogger.Debugf("SyncStoresSkus2 failed2 store:%d failed with error:%v", storeMap.StoreID, err)
|
globals.SugarLogger.Debugf("SyncStoresSkus2 failed2 store:%d failed with error:%v", storeMap.StoreID, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user