Skip to content

Commit

Permalink
revert d2bf036: servr::random_port() is quiet now
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed May 27, 2020
1 parent b93f46f commit fac62ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Description: Use the paged media properties in CSS and the JavaScript
running headers, etc. Applications of this package include books, letters,
reports, papers, business cards, resumes, and posters.
Imports: rmarkdown (>= 1.16), bookdown (>= 0.8), htmltools, jsonlite, later (>= 1.0.0),
processx, servr (>= 0.13), httpuv, xfun, websocket
processx, servr (>= 0.18), httpuv, xfun, websocket
Suggests: promises, testit, xaringan, pdftools, revealjs
License: MIT + file LICENSE
URL: https://github.com/rstudio/pagedown
Expand Down
4 changes: 2 additions & 2 deletions R/chrome.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ chrome_print = function(
'--headless', '--no-first-run', '--no-default-browser-check', '--hide-scrollbars'
))

debug_port = random_port()
debug_port = servr::random_port()
ps = processx::process$new(browser, c(
paste0('--remote-debugging-port=', debug_port),
paste0('--user-data-dir=', work_dir), extra_args
Expand Down Expand Up @@ -132,7 +132,7 @@ chrome_print = function(
)
svr = servr::httd(
dirname(url), daemon = TRUE, browser = FALSE, verbose = verbose >= 1,
port = random_port(), initpath = httpuv::encodeURIComponent(basename(url))
port = servr::random_port(), initpath = httpuv::encodeURIComponent(basename(url))
)
stop_server = function(...) {
if (verbose >= 1) message('Closing local webserver')
Expand Down
4 changes: 0 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ to_json = function(x, ..., auto_unbox = TRUE, null = 'null') {
jsonlite::toJSON(x, ..., auto_unbox = auto_unbox, null = null)
}

# don't prefer the port 4321 (otherwise we may see the meaningless error message
# "createTcpServer: address already in use" too often)
random_port = function() servr::random_port(NULL)

`%n%` = knitr:::`%n%`

run_servr = function() {
Expand Down

0 comments on commit fac62ca

Please sign in to comment.