- 重构tasksch

This commit is contained in:
gazebo
2019-08-01 16:20:52 +08:00
parent 66fcd42fc6
commit 852fff6eff
5 changed files with 131 additions and 118 deletions

View File

@@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"reflect"
"strings"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
@@ -421,19 +420,19 @@ func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendo
return nil, partner.AddVendorInfo2Err(err, loopMapInfo.VendorID)
}, isContinueWhenError)
if task != nil {
if vendorErr := partner.IsErrChangePriceFailed(task.GetOriginalErr()); vendorErr != nil {
platformList := make([]string, len(task.GetDetailErrList()))
for k, v := range task.GetDetailErrList() {
if vendorErr := partner.IsErrVendorError(v); vendorErr != nil {
platformList[k] = model.VendorChineseNames[vendorErr.VendorID()]
} else {
platformList[k] = "未知"
}
}
err = fmt.Errorf("同步价格失败\n失败平台%s", strings.Join(platformList, ","))
} else {
err = makeSyncError(err)
}
// if vendorErr := partner.IsErrChangePriceFailed(task.GetOriginalErr()); vendorErr != nil {
// platformList := make([]string, len(task.GetDetailErrList()))
// for k, v := range task.GetDetailErrList() {
// if vendorErr := partner.IsErrVendorError(v); vendorErr != nil {
// platformList[k] = model.VendorChineseNames[vendorErr.VendorID()]
// } else {
// platformList[k] = "未知"
// }
// }
// err = fmt.Errorf("同步价格失败\n失败平台%s", strings.Join(platformList, ","))
// } else {
// }
err = makeSyncError(err)
}
return hint, err
}