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)
|
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
|
client.MsgChan <- dataByte
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user