In my shiny app, data is updated daily, and so are some global variables my app needs to function correctly. Therefore, every time the underlying data updates I overwrite a file called "stage_data.Rdata" that contains the workspace needed by both my ui.R and server.R programs.
Here is the contents of global.R:
# clear workspace and load in new workspace just in case its changed
rm(list=ls())
load("stage_data.Rdata")
The problem: if global.R is not changed and re-saved, shiny server doesn't seem to re-run global.R and thus, my statement: load(stage_data.Rdata) doesn't run either. As a result, I'm working with old workspace variables until I intervene. Specifically, I open global.R and make some small change (like adding a space or #) and re-saving the program. If I restart shiny server, that also works. How can I make shiny server read global.R every session without my intervention?