mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-12 06:45:46 +08:00
fix #108.
This commit is contained in:
parent
f325b26e1a
commit
1a1f860dbe
@ -179,11 +179,9 @@ func (c *websocketClient) listenApi(conn *wsc.Conn, u bool) {
|
||||
}
|
||||
if c.conf.ReverseReconnectInterval != 0 {
|
||||
time.Sleep(time.Millisecond * time.Duration(c.conf.ReverseReconnectInterval))
|
||||
if u {
|
||||
c.connectUniversal()
|
||||
return
|
||||
if !u {
|
||||
c.connectApi()
|
||||
}
|
||||
c.connectApi()
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +202,15 @@ func (c *websocketClient) onBotPushEvent(m coolq.MSG) {
|
||||
}
|
||||
if c.universalConn != nil {
|
||||
log.Debugf("向WS服务器 %v 推送Event: %v", c.universalConn.RemoteAddr().String(), m.ToJson())
|
||||
_, _ = c.universalConn.Write([]byte(m.ToJson()))
|
||||
if _, err := c.universalConn.Write([]byte(m.ToJson())); err != nil {
|
||||
_ = c.universalConn.Close()
|
||||
if c.conf.ReverseReconnectInterval != 0 {
|
||||
go func() {
|
||||
time.Sleep(time.Millisecond * time.Duration(c.conf.ReverseReconnectInterval))
|
||||
c.connectUniversal()
|
||||
}()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user