Skip to content

Commit

Permalink
Timeout package caches
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Feb 11, 2016
1 parent aeba45d commit 584babd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Imports:
utils,
tools,
methods,
memoise,
memoise (>= 1.0.0),
whisker,
digest,
rstudioapi (>= 0.2.0),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# devtools 1.10.0.9000

* Package index caches for `revdep_check()` now time out after 30 minutes.

* `revdep_check_save_logs()` has been removed.

* Experimental `revdep_email()` to individual email each maintainer with
Expand Down
25 changes: 15 additions & 10 deletions R/revdep.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,18 @@ check_dirs <- function(path) {

# Package caches ----------------------------------------------------------

cran_packages <- memoise::memoise(function() {
local <- file.path(tempdir(), "packages.rds")
utils::download.file("http://cran.R-project.org/web/packages/packages.rds", local,
mode = "wb", quiet = TRUE)
on.exit(unlink(local))
cp <- readRDS(local)
rownames(cp) <- unname(cp[, 1])
cp
})
cran_packages <- memoise::memoise(
function() {
local <- file.path(tempdir(), "packages.rds")
utils::download.file("http://cran.R-project.org/web/packages/packages.rds", local,
mode = "wb", quiet = TRUE)
on.exit(unlink(local))
cp <- readRDS(local)
rownames(cp) <- unname(cp[, 1])
cp
},
~timeout(30 * 60)
)

bioc_packages <- memoise::memoise(
function(views = paste(BiocInstaller::biocinstallRepos()[["BioCsoft"]], "VIEWS", sep = "/")) {
Expand All @@ -224,7 +227,9 @@ bioc_packages <- memoise::memoise(
bioc <- read.dcf(con)
rownames(bioc) <- bioc[, 1]
bioc
})
},
~timeout(30 * 60)
)

packages <- function() {
cran <- cran_packages()
Expand Down

0 comments on commit 584babd

Please sign in to comment.