- write important error msg to db.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package defsch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"math/rand"
|
||||
@@ -365,6 +366,14 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("createWaybillOn3rdProviders, orderID:%s failed %d times, stop schedule", order.VendorOrderID, savedOrderInfo.retryCount-1)
|
||||
|
||||
tmpLog := &legacymodel.TempLog{
|
||||
VendorOrderID: order.VendorOrderID,
|
||||
RefVendorOrderID: order.VendorOrderID,
|
||||
Msg: fmt.Sprintf("createWaybillOn3rdProviders, orderID:%s failed %d times, stop schedule", order.VendorOrderID, savedOrderInfo.retryCount-1),
|
||||
}
|
||||
db := orm.NewOrm()
|
||||
db.Insert(tmpLog)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("createWaybillOn3rdProviders, orderID:%s, store:%d dont't support 3rd delivery platform", order.VendorOrderID, jxutils.GetJxStoreIDFromOrder(order))
|
||||
@@ -396,7 +405,16 @@ func (s *DefScheduler) swtich2SelfDeliverWithRetry(order *model.GoodsOrder, bill
|
||||
}, order.VendorOrderID)
|
||||
})
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("swtich2SelfDeliverWithRetry finally failed, cancel bill:%v, err:%v", bill, err)
|
||||
globals.SugarLogger.Infof("swtich2SelfDeliverWithRetry finally failed, orderID:%s bill:%v, err:%v", order.VendorOrderID, bill, err)
|
||||
|
||||
tmpLog := &legacymodel.TempLog{
|
||||
VendorOrderID: bill.VendorWaybillID,
|
||||
RefVendorOrderID: order.VendorOrderID,
|
||||
Msg: fmt.Sprintf("swtich2SelfDeliverWithRetry finally failed, orderID:%s bill:%v, err:%v", order.VendorOrderID, bill, err),
|
||||
}
|
||||
db := orm.NewOrm()
|
||||
db.Insert(tmpLog)
|
||||
|
||||
if s.CancelWaybill(bill) == nil {
|
||||
// 转自送失败的取消,要将订单中的运单状态更新
|
||||
if s.isBillCandidate(order, bill) {
|
||||
|
||||
Reference in New Issue
Block a user