servr does not reclaim daemonised servers after deamon_stop()
Opened this issue · 1 comments
Deleted user commented
My understanding of how deamon_stop()
works is that it should reclaim the indexes of daemonised servers that have been stopped. This doesn't appear to happen when this workflow is followed:
- Download https://github.com/rstudio/bookdown-demo
- Launch the bookdown-demo.Rproj project
- Run the following
bookdown:::serve_book()
servr::daemon_stop(1)
bookdown:::serve_book()
servr::daemon_stop(1)
- Unexpectedly, the second serving of the book is hosted on deamonised server
2
servr::daemon_list()
# [1] 2
Is this expected behaviour?
yihui commented
The index is incremented each time a server is started. daemon_stop()
stops and removes the server. It doesn't do anything about the indexes.
In your case, the second bookdown:::serve_book()
must have instructed you that the way to stop the server is servr::daemon_stop(2)
instead of servr::daemon_stop(1)
.