R/cache.R
The purpose of this function is
to prepare the cache to be called from make()
.
configure_cache(cache = drake::get_cache(verbose = verbose), short_hash_algo = drake::default_short_hash_algo(cache = cache), long_hash_algo = drake::default_long_hash_algo(cache = cache), log_progress = FALSE, overwrite_hash_algos = FALSE, verbose = drake::default_verbose(), jobs = 1)
cache | cache to configure |
---|---|
short_hash_algo | short hash algorithm for drake.
The short algorithm must be among |
long_hash_algo | long hash algorithm for drake.
The long algorithm must be among |
log_progress | deprecated logical.
Previously toggled whether to clear the recorded
build progress if this cache was used for previous calls to
|
overwrite_hash_algos | logical, whether to try to overwrite the hash algorithms in the cache with any user-specified ones. |
verbose | logical or numeric, control printing to the console.
Use
|
jobs | number of jobs for parallel processing |
A drake/storr cache.
default_short_hash_algo()
,
default_long_hash_algo()
# NOT RUN { test_with_dir("Quarantine side effects.", { clean(destroy = TRUE) load_basic_example() # Get the code with drake_example("basic"). config <- make(my_plan) # Run the project, build all the targets. # Locate the drake/storr cache of the project # inside the master internal configuration list. cache <- config$cache long_hash(cache) # Return the long hash algorithm used. # Change the long hash algorithm of the cache. cache <- configure_cache( cache = cache, long_hash_algo = "murmur32", overwrite_hash_algos = TRUE ) long_hash(cache) # Show the new long hash algorithm. make(my_plan) # Changing the long hash puts the targets out of date. }) # }