Skip to content

Commit de5c60e

Browse files
author
Stefan Fleck
committed
doc
1 parent cf38149 commit de5c60e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

R/Cache.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

tests/testthat/test_Cache.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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()
108
assign("id", 0L, .id_cache)
119
ascending_id <- function(){

0 commit comments

Comments
 (0)