Add read timeout
This commit is contained in:
parent
ed864deeaf
commit
91cd88b101
|
@ -91,6 +91,8 @@ func (t *TwitchPubSub) Open() error {
|
|||
return err
|
||||
}
|
||||
|
||||
c.SetReadDeadline(45 * time.Second)
|
||||
|
||||
t.wsConn = c
|
||||
|
||||
t.listening = make(chan interface{})
|
||||
|
@ -290,7 +292,7 @@ func (t *TwitchPubSub) reader(wsConn *websocket.Conn, listening <-chan interface
|
|||
}
|
||||
|
||||
func (t *TwitchPubSub) pinger(wsConn *websocket.Conn, listening <-chan interface{}) {
|
||||
ticker := time.NewTicker(150 * time.Second)
|
||||
ticker := time.NewTicker(30 * time.Second)
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
|
|
Loading…
Reference in New Issue