diff --git a/business/msghub/msghub.go b/business/msghub/msghub.go index 0dc10ea5f..58af5d94a 100644 --- a/business/msghub/msghub.go +++ b/business/msghub/msghub.go @@ -65,12 +65,12 @@ func routinueFunc() { close(registerMsg.Chan2Close) case ServerMsgNewOrder: globals.SugarLogger.Debugf("msghub routinueFunc, msg:%s", utils.Format4Output(msg, false)) - go func() { + utils.CallFuncAsync(func() { for chan2Send := range channelMap[msg.StoreID] { chan2Send <- msg delete(channelMap[msg.StoreID], chan2Send) } - }() + }) } } } @@ -139,7 +139,7 @@ func GetMsg(ctx *jxcontext.Context, storeID int, lastOrderTime time.Time, lastOr func OnNewOrder(order *model.GoodsOrder) { globals.SugarLogger.Debugf("msghub OnNewOrder, order:%s", utils.Format4Output(order, false)) - go func() { + utils.CallFuncAsync(func() { msgChan <- &ServerMsg{ Type: ServerMsgNewOrder, StoreID: jxutils.GetSaleStoreIDFromOrder(order), @@ -149,5 +149,5 @@ func OnNewOrder(order *model.GoodsOrder) { }, }, } - }() + }) }