diff --git a/R/server.R b/R/server.R index 5b8c5d9..9e3f883 100644 --- a/R/server.R +++ b/R/server.R @@ -30,14 +30,9 @@ server <- function(input, output, session) { results <- withProgress( message = "Analyzing genes", value = 0.0, { - run_cached( - rlang::hash(preset), - geposan::analyze, - preset, - function(progress) { - setProgress(progress) - } - ) + geposan::analyze(preset, function(progress) { + setProgress(progress) + }) } ) diff --git a/R/utils.R b/R/utils.R index a373fac..cd2c6db 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,29 +1,3 @@ -# Run a function caching the result on the file system. -# -# The function will be called with the appended arguments. The [`id`] argument -# will be used to identify the cache file on the file system and in log -# messages. -run_cached <- function(id, func, ...) { - if (!dir.exists("cache")) { - dir.create("cache") - } - - cache_file <- paste("cache/", id, ".rds", sep = "") - - if (file.exists(cache_file)) { - # If the cache file exists, we restore the data from it. - readRDS(cache_file) - } else { - # If the cache file doesn't exist, we have to do the computation. - data <- func(...) - - # The results are cached for the next run. - saveRDS(data, cache_file) - - data - } -} - # This is needed to make data.table's and shiny's symbols available within the # package. #' @import data.table