- 饿百忽略“SKU不存在或者已经被删除”错误
This commit is contained in:
@@ -255,6 +255,7 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
if storeSku.EbaiSyncStatus&model.SyncFlagNewMask == 0 && !jxutils.IsEmptyID(storeSku.EbaiID) {
|
||||
if globals.EnableEbaiStoreWrite {
|
||||
err = api.EbaiAPI.SkuDelete(strStoreID, utils.Int64ToStr(storeSku.EbaiID))
|
||||
err = ignoreNoSkuErr(err)
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
@@ -324,6 +325,17 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
return rootTask.ID, err
|
||||
}
|
||||
|
||||
func ignoreNoSkuErr(err error) error {
|
||||
if err != nil {
|
||||
if codeErr, ok := err.(*utils.ErrorWithCode); ok {
|
||||
if codeErr.IntCode() == 1 && strings.Index(codeErr.ErrMsg(), "SKU不存在或者已经被删除") > 0 {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func skuUpdate(strStoreID string, storeSku *tStoreSkuFullInfo) (err error) {
|
||||
if globals.EnableEbaiStoreWrite {
|
||||
if _, err = api.EbaiAPI.SkuUpdate(strStoreID, storeSku.EbaiID, genSkuParamsFromStoreSkuInfo(storeSku)); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user