diff --git a/auth.go b/auth.go index 1f11909..2a9d810 100644 --- a/auth.go +++ b/auth.go @@ -39,7 +39,7 @@ func unauthorized(c *websocket.Conn, err error) error { func getAuthMessage(c *websocket.Conn, s *Session) error { // timeout after 2 seconds if no request is sent - c.SetReadDeadline(time.Now().Add(time.Second * 2)) + c.SetReadDeadline(time.Now().Add(time.Second * 5)) _, message, err := c.ReadMessage() if err != nil { diff --git a/build.go b/build.go index 6d558c1..77a49fa 100644 --- a/build.go +++ b/build.go @@ -50,7 +50,7 @@ func processBuild(msg *nats.Msg) { bc.Publish(id, data) go func(bc *broadcast.Server) { // Wait for any late connecting clients before closing stream - time.Sleep(broadcast.DefaultMaxInactivity) + time.Sleep(time.Second * 10) log.Println("Closing stream: ", id) }(bc) }