I have deployed an app in shinyapps.io and its working fine.
I am running the app for only 5 minutes, but when I checked the metrics it shows a running time for about 0.7 hours. I found that there is a default idle time of 15 minutes, which I have changed to 5 minutes (minimum). I also noticed that, even after closing the browser window of the shiny app, it still shows the app as running in my dashboard.
I assume that the app doesn't stop running when a browser window is closed and it will stop only when the idle time condition is met.
Is there a way to stop the shiny app when the browser window is closed? Would the following piece of code work in this instance?
session$onSessionEnded(function() {
stopApp()
})