I have a shiny application that queries data from SQL into data frames, and then those data frames are referenced from my shinyServer() block. I've been running it only in RStudio thus far, and so whenever I needed new data I'd just restart the application and before the server loads it would grab all new data.
I'd like to transition the app to shiny server, but I'm not sure how I can induce it to get new data periodically. For the sake of the interface I'd like it to be automatic rather than have a user click a button to initiate the loading. Is there an idiomatic solution for this?
EDIT:
I think I found a solution that works for me.
shinyServer(function(input,output,session){
sourceData <- reactive({
invalidateLater(1000000,session)
functionThatGetsData()
})
})
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…