Skip to content

Commit

Permalink
feat: 修复 HTTP 服务器满消息空指针问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Dec 29, 2023
1 parent 7086281 commit 68bc005
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ func (srv *Server) pushMessage(message *Message) {
func (srv *Server) low(message *Message, present time.Time, expect time.Duration, messageReplace ...string) {
cost := time.Since(present)
if cost > expect {
if message == nil {
log.Warn("ServerLowMessage", log.String("type", "HTTP"), log.String("cost", cost.String()), log.Any("message", messageReplace))
srv.OnMessageLowExecEvent(nil, cost)
return
}
if len(messageReplace) > 0 {
for i, s := range messageReplace {
message.marks = append(message.marks, log.String(fmt.Sprintf("Other-%d", i+1), s))
Expand Down

0 comments on commit 68bc005

Please sign in to comment.