title: How to trigger a data refresh in shiny?
body: <p>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.</p>
  
  <p>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?</p>
  
  <p>EDIT:</p>
  
  <p>I think I found a solution that works for me.</p>
  
  <pre><code>shinyServer(function(input,output,session){
      sourceData &lt;- reactive({
          invalidateLater(1000000,session)
  
          functionThatGetsData()
      })
  })
  </code></pre>