- 修复发送订单消息的BUG
This commit is contained in:
@@ -68,7 +68,7 @@ func routinueFunc() {
|
||||
delete(channelMap[registerMsg.StoreID], registerMsg.Chan2Listen)
|
||||
close(registerMsg.Chan2Close)
|
||||
case ServerMsgNewOrder, ServerMsgKeyOrderStatusChanged:
|
||||
globals.SugarLogger.Debugf("msghub routinueFunc, msg:%s", utils.Format4Output(msg, false))
|
||||
globals.SugarLogger.Debugf("msghub routinueFunc, msg:%s", utils.Format4Output(msg, true))
|
||||
utils.CallFuncAsync(func() {
|
||||
for chan2Send := range channelMap[msg.StoreID] {
|
||||
chan2Send <- msg
|
||||
@@ -138,7 +138,7 @@ func GetMsg(ctx *jxcontext.Context, storeID int, lastOrderTime time.Time, lastOr
|
||||
case msg2, ok := <-chan2Listen:
|
||||
timer.Stop()
|
||||
if ok {
|
||||
msg.MsgData = msg2.MsgData
|
||||
msg = msg2
|
||||
}
|
||||
case <-timer.C:
|
||||
unregisterChan(storeID, chan2Listen)
|
||||
@@ -152,7 +152,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))
|
||||
globals.SugarLogger.Debugf("msghub OnNewOrder, order:%s", utils.Format4Output(order, true))
|
||||
utils.CallFuncAsync(func() {
|
||||
msgChan <- &ServerMsg{
|
||||
Type: ServerMsgNewOrder,
|
||||
@@ -168,7 +168,7 @@ func OnNewOrder(order *model.GoodsOrder) {
|
||||
}
|
||||
|
||||
func OnKeyOrderStatusChanged(order *model.GoodsOrder) {
|
||||
globals.SugarLogger.Debugf("msghub OnKeyOrderStatusChanged, order:%s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("msghub OnKeyOrderStatusChanged, order:%s", utils.Format4Output(order, true))
|
||||
utils.CallFuncAsync(func() {
|
||||
msgChan <- &ServerMsg{
|
||||
Type: ServerMsgKeyOrderStatusChanged,
|
||||
|
||||
Reference in New Issue
Block a user