Skip to content

Commit

Permalink
fix: server 修复消息计数始终为1的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Sep 8, 2023
1 parent 483ace2 commit 6c882ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,13 @@ func (slf *Server) pushMessage(message *Message) {
defer slf.OnShuntChannelCreatedEvent(channelGuid)
}
if channel != nil {
slf.messageCounter.Add(1)
channel <- message
return
}
}
slf.messageCounter.Add(1)
slf.messageChannel <- message

}

func (slf *Server) low(message *Message, present time.Time, expect time.Duration, messageReplace ...string) {
Expand All @@ -616,7 +617,6 @@ func (slf *Server) low(message *Message, present time.Time, expect time.Duration

// dispatchMessage 消息分发
func (slf *Server) dispatchMessage(msg *Message) {
slf.messageCounter.Add(1)
var (
ctx context.Context
cancel context.CancelFunc
Expand Down

0 comments on commit 6c882ed

Please sign in to comment.