mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
Fix app- and session-level cache initialization
This commit is contained in:
@@ -598,12 +598,9 @@ runApp <- function(appDir=getwd(),
|
||||
)
|
||||
on.exit(options(ops), add = TRUE)
|
||||
|
||||
# Set up default disk cache for app. Default is 5 MB in size.
|
||||
# Set up default cache for app.
|
||||
if (is.null(getShinyOption("cache"))) {
|
||||
cacheDir <- file.path(tempdir(), paste0("shinyapp-", getShinyOption("appToken")))
|
||||
cache <- MemoryCache$new()
|
||||
on.exit(cache$destroy(), add = TRUE)
|
||||
shinyOptions(cache = cache)
|
||||
shinyOptions(cache = MemoryCache$new())
|
||||
}
|
||||
|
||||
appParts <- as.shiny.appobj(appDir)
|
||||
|
||||
@@ -738,16 +738,7 @@ ShinySession <- R6Class(
|
||||
private$.outputs <- list()
|
||||
private$.outputOptions <- list()
|
||||
|
||||
# Session-level cache
|
||||
cacheDir <- file.path(
|
||||
tempdir(),
|
||||
paste0("shinyapp-", getShinyOption("appToken")),
|
||||
paste0("session-", self$token)
|
||||
)
|
||||
private$cache <- MemoryCache$new()
|
||||
# Destroy the cache when the session exits. This is more predictable
|
||||
# than using destroy_on_finalize.
|
||||
self$onSessionEnded(private$cache$destroy)
|
||||
|
||||
private$bookmarkCallbacks <- Callbacks$new()
|
||||
private$bookmarkedCallbacks <- Callbacks$new()
|
||||
|
||||
Reference in New Issue
Block a user