File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -301,6 +301,13 @@ Cache <- R6::R6Class(
301301 # ' a storage key must be supplied manually in `cache$push()`. If a new
302302 # ' object is added with the same key as an existing object, the existing
303303 # ' object will be overwritten without warning.
304+ # '
305+ # ' *Note:*
306+ # ' If hashfun is something that generates a unique ID instead of a hash,
307+ # ' it is recommended to use a lexically sortable unique ID (such as ulid).
308+ # ' This ensures that `$prune()` and co will delete objects in order of
309+ # ' their creation at sub-second accuracy. This is only an issue on
310+ # ' file-systems with low precission timestamp such as ext3 or FAT.
304311 hashfun = function (fun ){
305312 if (missing(fun )){
306313 res <- get(" .hashfun" , envir = private )
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ context("Cache")
44# generate lexically sortable ids. For equal timestamp, Cache$files is sorted
55# by id, so that the tests do not fail on file systems with low-accuracy
66# timestamps
7-
8-
97.id_cache <- new.env()
108assign(" id" , 0L , .id_cache )
119ascending_id <- function (){
You can’t perform that action at this time.
0 commit comments