- 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

@@ -156,7 +156,7 @@ func (c *PurchaseHandler) replyOrderComment(intOrderID int64, jdStoreNo string,
delaySeconds := config.delayGapBegin + rand.Intn(config.delayGapEnd-config.delayGapBegin)
content := config.comments[rand.Intn(len(config.comments))]
globals.SugarLogger.Debugf("replyOrderComment orderID:%d, delaySeconds:%d, content:%s", intOrderID, delaySeconds, content)
time.AfterFunc(time.Duration(delaySeconds)*time.Second, func() {
utils.AfterFuncWithRecover(time.Duration(delaySeconds)*time.Second, func() {
// err2 := utils.CallFuncLogError(func() error {
// if globals.ReallyCallPlatformAPI {
// return api.JdAPI.OrgReplyComment(intOrderID, jdStoreNo, content, utils.GetAPIOperator(""))