mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
Merge pull request #161 from AkkiaS7/master
optimise: 优化websocket数据包发送逻辑 加快首次访问时监控信息载入速度 Co-authored-by: AkkiaS7 <68485070+AkkiaS7@users.noreply.github.com>
This commit is contained in:
commit
0a7044f78c
@ -182,12 +182,7 @@ func (cp *commonPage) ws(c *gin.Context) {
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
writer, err := conn.NextWriter(websocket.TextMessage)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
_, err = writer.Write(stat)
|
||||
if err != nil {
|
||||
if err := conn.WriteMessage(websocket.TextMessage, stat); err != nil {
|
||||
break
|
||||
}
|
||||
count += 1
|
||||
|
Loading…
Reference in New Issue
Block a user