Can I schedule an app on R Studio Connect based on the result of another program?

Hello All,

I'd like to have my app run after the daily data refresh is complete. I have a program to check if the data refresh is complete. Can I schedule the app based on that result? Or any suggestions how I can do that?

Thanks.
Mira

To my knowledge, RStudio Connect does offer scheduling only on time & date and does not offer scheduling on a hook or alike. However, I may not know the inside out of the project. :man_shrugging: If I am right, that would be a great feature request. :+1:

Here is a quick thought on this. One way would be to deploy a new content to start the running of the app like a schechuling.
There is several ways to deploy to rstudio connect, including a programmatic way and a Git-based way. That means at the end of your program to check if data refresh is complete, you may be able to start a deployment programmatically by sending the source of your app to connect for a new deployment. This programmatic deployment could be done by your other program or using a CI/CD system if you have one.
Otherwise, you may tag your git repo for a new version and that would schedule a new deployment if you configure connect that way for git deployment.

Hope it helps. And let's see if someone have a better solution ! :crossed_fingers:

If the goal is to have an app show latest available data, it may be possible to do this without any new scheduling on Connect at all.

There are some well defined patterns available, I'd recommend looking at reactivePoll, https://shiny.rstudio.com/reference/shiny/latest/reactivePoll.html, which is going to be an easy way to check and see if new data is available.

The nice thing about these functions is that they will work regardless of when the data is updated or the shiny app is loaded. Outside of that, you have to be quite clever to ensure the client and server processes stay in sync, there are many edge cases!

1 Like