- replace all goroutine and AfterFunc with recover version
This commit is contained in:
@@ -291,9 +291,9 @@ func (c *PurchaseHandler) postFakeFinishedPickupMsg(vendorOrderID string) {
|
||||
"order_id": vendorOrderID,
|
||||
},
|
||||
}
|
||||
go func() {
|
||||
utils.CallFuncAsync(func() {
|
||||
OnCallbackMsg(msg)
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
func getTimeFromTimestampStr(sendTime string) time.Time {
|
||||
|
||||
@@ -21,14 +21,14 @@ const (
|
||||
)
|
||||
|
||||
func (c *PurchaseHandler) StartRefreshComment() {
|
||||
time.AfterFunc(5*time.Second, func() {
|
||||
utils.AfterFuncWithRecover(5*time.Second, func() {
|
||||
c.refreshCommentOnce()
|
||||
})
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) refreshCommentOnce() {
|
||||
c.RefreshComment(time.Now().Add(-RefreshCommentTime), time.Now())
|
||||
time.AfterFunc(RefreshCommentTimeInterval, func() {
|
||||
utils.AfterFuncWithRecover(RefreshCommentTimeInterval, func() {
|
||||
c.refreshCommentOnce()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
// 饿百支持创建sku时绑定商家分类了
|
||||
// isCreate = true
|
||||
// // 创建SKU后马上绑定分类,会失败,所以延迟绑定
|
||||
// time.AfterFunc(3*time.Second, func() {
|
||||
// utils.AfterFuncWithRecover(3*time.Second, func() {
|
||||
// if err := api.EbaiAPI.SkuShopCategoryMap(strStoreID, storeSku.EbaiID, utils.Int64ToStr(storeSku.CatEbaiID)); err == nil {
|
||||
// storeSku.EbaiSyncStatus = 0
|
||||
// dao.UpdateEntity(nil, &storeSku.StoreSkuBind, updateFields...)
|
||||
|
||||
Reference in New Issue
Block a user