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