Open RainfallNZ opened 8 months ago
Updating the data file so that it is loaded properly can be done several different ways, but the optimum is not obvious. See https://shiny.posit.co/r/articles/improve/scoping/ for some backgrouond on what gets loaded and when. It is possible to use a reactive file loader, but this seems to complicate everything. I have a failed example in app_reactive.r Alternatively, loading the data in the server function would probably work, but I think perhaps loads things more oftern than necessary. Using a "<<-" seems to be the best option, but whether it actually works remains to be seen.
The use of "<<-" to change the scope of the file loading didn't work.
See https://stackoverflow.com/questions/46719268/shiny-app-does-not-reflect-changes-in-update-rdata-file for some other ideas of how to fix the issue. Either use a reactive file loader, or check the file time-stamp to decide if file loading is required.
The images should be different each day, but sometimes they show yesterdays images. Suspect this is related to local caching. Maybe stop caching of images.