- replace all goroutine and AfterFunc with recover version

This commit is contained in:
gazebo
2019-03-15 10:26:30 +08:00
parent e5bf25bd04
commit dec14126a7
14 changed files with 30 additions and 29 deletions

View File

@@ -164,7 +164,7 @@ func (c *OrderManager) replyOrderComment(orderComment *model.OrderComment) (err
delaySeconds := config.delayGapBegin + rand.Intn(config.delayGapEnd-config.delayGapBegin)
content := config.comments[rand.Intn(len(config.comments))]
globals.SugarLogger.Debugf("replyOrderComment orderID:%s, delaySeconds:%d, content:%s", orderComment.VendorOrderID, delaySeconds, content)
time.AfterFunc(time.Duration(delaySeconds)*time.Second, func() {
utils.AfterFuncWithRecover(time.Duration(delaySeconds)*time.Second, func() {
if globals.ReallySendWeixinMsg {
if handler := partner.GetPurchasePlatformFromVendorID(orderComment.VendorID); handler != nil {
err = handler.ReplyOrderComment(jxcontext.AdminCtx, orderComment, content)