I tried this code to bypass shiny server timeout issue in free version. But it is not working.
inactivity <- "function idleTimer() {
var t = setTimeout(logout, 60000);
window.onmousemove = resetTimer; // catches mouse movements
window.onmousedown = resetTimer; // catches mouse movements
window.onclick = resetTimer; // catches mouse clicks
window.onscroll = resetTimer; // catches scrolling
window.onkeypress = resetTimer; //catches keyboard actions
function logout() {
//close the window
}
function resetTimer() {
clearTimeout(t);
t = setTimeout(logout, 60000); // time is in milliseconds (1000 is 1 second)
}
}
idleTimer();"
ui <- fluidPage(
tags$script(inactivity))
server <- function(session, input, output) {
points <- eventReactive(input$recalc, {
cbind(rnorm(40) * 2 + 13, rnorm(40) + 48)
}, ignoreNULL = FALSE)
})
shinyApp(ui, server)
I need to make a shiny app to be active for atleast 10 mins. This code is suppose to bypass the session timeout issue in free version. But it is getting timeout after 1 min. What has to be done?