I have shiny app, which is displaying old data (4 days delay!) though on the server data are refreshed (current day).
What is strange the old dataset does not exist on the server - seems only existing in Shiny cache.
On the server I have 1 dataset done by cron on May 18, and 1 dataset done by manual refresh 24 May. However Data in the app are from May 20! In the report I display date of dataset creation time - that's why I know the data does not exist any more.
Is it posible to reset Shiny cache somehow?
I also have simmilar problems for some other reports. What is strange for some reports it happends, for some not ...
Your application may be dependent on packages that are installed and loaded in your environment, but aren't installed for the correct user on the Shiny Server. Make sure that all necessary packages are installed for the same user set under run_as in your Shiny Server configuration file.
I found that cache of R Shiny server is updated when the date of creation for the file "app.R" is changed.
So, here is the trick I used:
server <- function(input, output, session) {
# Trick file date creation update
onStop(function() {
# File name
p <- paste0(getwd(), "/app.R")
# Update file 'date creation'
Sys.setFileTime(p, now())
}) # onStop
...
} # server
The idea is to update the date of "app.R" creation after each session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With