sourcoise_lapse: Change Cache Lapse Policy

View source: R/change.R

sourcoise_lapseR Documentation

Change Cache Lapse Policy

Description

Updates the lapse policy metadata for cached files associated with a given path. The lapse policy determines when cached results should expire.

Usage

sourcoise_lapse(path, lapse = "never", root = getOption("sourcoise.root"))

Arguments

path

Character string specifying the file path whose cache metadata should be updated.

lapse

Character string specifying the lapse policy. Default is "never". Common values include "never", "daily", "weekly", or custom time periods.

root

Character string specifying the root directory for the cache. Defaults to getOption("sourcoise.root").

Details

The function locates all cache entries for the specified path, filters to the most recent entry for each argument hash, and updates the lapse policy metadata only for entries where the current lapse value differs from the specified value.

Value

Invisibly returns the results of writing metadata for each updated cache entry. Returns a message string if no files are found or no changes are needed.

Examples

## Not run: 
# Set cache to expire daily
sourcoise_lapse("scripts/analysis.R", lapse = "daily")

# Set cache to never expire (default)
sourcoise_lapse("scripts/model.R", lapse = "never")

## End(Not run)

sourcoise documentation built on Jan. 8, 2026, 1:07 a.m.