webtty: upgrade Run to use an errgroup to join 2 i/o routines

This commit is contained in:
Will Owens 2025-10-26 13:17:02 -05:00
parent c830287cb0
commit b5d904cb14
No known key found for this signature in database
GPG key ID: 8C8384B16B623DA6
4 changed files with 52 additions and 41 deletions

View file

@ -165,8 +165,11 @@ func (server *Server) processWSConn(ctx context.Context, conn *websocket.Conn) e
}
err = tty.Run(ctx)
if err != nil && !errors.Is(err, context.Canceled) {
return err
}
return err
return nil
}
func (server *Server) handleIndex(w http.ResponseWriter, r *http.Request) {