diff --git a/pubsub.go b/pubsub.go index 1ca2bf8..626a612 100644 --- a/pubsub.go +++ b/pubsub.go @@ -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 {