Learn R Programming

drake (version 5.0.0)

rescue_cache: Try to repair a drake cache that is prone to throwing storr-related errors.

Description

Sometimes, storr caches may have dangling orphaned files that prevent you from loading or cleaning. This function tries to remove those files so you can use the cache normally again.

Usage

rescue_cache(targets = NULL, path = getwd(), search = TRUE, verbose = 1,
  force = FALSE, cache = drake::get_cache(path = path, search = search,
  verbose = verbose, force = force), jobs = 1, garbage_collection = FALSE)

Arguments

targets

Character vector, names of the targets to rescue. As with many other drake utility functions, the word target is defined generally in this case, encompassing imports as well as true targets. If targets is NULL, everything in the cache is rescued.

path

same as for get_cache()

search

same as for get_cache()

verbose

same as for get_cache()

force

same as for get_cache()

cache

a `storr` cache object

jobs

number of jobs for light parallelism (disabled on Windows)

garbage_collection

logical, whether to do garbage collection as a final step. See drake_gc and clean for details.

Value

The rescued drake/storr cache.

See Also

get_cache, cached, drake_gc, clean

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_basic_example() # Get the code with drake_example("basic").
make(my_plan) # Run the project, build targets. This creates the cache.
# Remove dangling cache files that could cause errors.
rescue_cache(jobs = 2)
# Alternatively, just rescue targets 'small' and 'large'.
# Rescuing specific targets is usually faster.
rescue_cache(targets = c("small", "large"))
})
# }

Run the code above in your browser using DataLab