purge_cache: Purge older files from the local cache.

View source: R/purge_cache.R

purge_cacheR Documentation

Purge older files from the local cache.

Description

Deletes oldest files until cache size is below the threshold size. Additionally, users can specify a maximum age in days to delete all files older than the threshold, which can speed up file purge in large stores. Setting either age and threshold to 0 will purge everything from cache.

Usage

purge_cache(threshold = "1G", age = Inf, dir = content_dir(), verbose = TRUE)

Arguments

threshold

Threshold size, accepts ⁠[fs::fs_bytes]⁠ notation.

age

Maximum age in days

dir

the path we should use for permanent / on-disk storage of the registry. An appropriate default will be selected (also configurable using the environmental variable CONTENTID_HOME), if not specified.

verbose

show deleted file paths?

Details

Default behavior will keep contentid's local store size below 1 GB. Note that contentid functions do not automatically call purge_cache(), this must be handled by user workflows.

Value

invisibly returns directory path


cboettig/contentid documentation built on Oct. 24, 2023, 1:03 p.m.