fix: ws消息无消费chan溢出关闭
This commit is contained in:
@@ -41,6 +41,10 @@ func (s *WSSendImpl) ByClientID(clientID string, data any) error {
|
||||
}
|
||||
|
||||
client := v.(*model.WSClient)
|
||||
if len(client.MsgChan) > 90 {
|
||||
NewWSImpl.CloseClient(client.ID)
|
||||
return fmt.Errorf("msg chan over 90 will close client ID: %s", clientID)
|
||||
}
|
||||
client.MsgChan <- dataByte
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user