1

After 1 minute, my shiny dashboard closes by himself. The same probleme occurs if I open it in the browser but this time, the whole window become shaded. I can always go to one menuItem to another but the series doesn't appear.

I would like the shiny dashboard to never shutdown and to be ready to use at any time even if I left the dashboard for a certain amount of time.

EDIT

Even if I try the code of here( answer of ismirsehregal), my dashboard always close.

ui <- dashboardPage(
  dashboardHeader(),

  dashboardSidebar(),

  dashboardBody(tags$head(tags$style(HTML("<script>
                                                var socket_timeout_interval
                                                var n = 0
                                                $(document).on('shiny:connected', function(event) {
                                                socket_timeout_interval = setInterval(function(){
                                                Shiny.onInputChange('count', n++)
                                                }, 15000)
                                                });
                                                $(document).on('shiny:disconnected', function(event) {
                                                clearInterval(socket_timeout_interval)
                                                });
                                            </script>"))),
                                                      textOutput("keepAlive")))

server <- function(input, output, session) {

  output$keepAlive <- renderText({
    req(input$count)
    paste("keep alive ", input$count)
  })}

shinyApp(ui, server)
Forzan
  • 117
  • 11
  • 1
    How do you deploy your app? [This](https://support.dominodatalab.com/hc/en-us/articles/360015932932-Increasing-the-timeout-for-Shiny-Server) might be of interest. – ismirsehregal May 29 '19 at 17:25
  • I deploy it with R cloud so i'm using the non pro version of the Shiny Server. Thanks for the answer I tried (see the edit) but it didn't worked, I put the code if I did something wrong. – Forzan May 30 '19 at 07:20
  • 1
    You could try [this](https://stackoverflow.com/questions/54594781/how-to-prevent-a-shiny-app-from-being-grayed-out/54604662#54604662). – Stéphane Laurent Jun 03 '19 at 08:48
  • Yes it works but I long do you think it can last ? if I want to let the dashboard for 10 hours, at the end, there will be too much dot to handle isn't it ? – Forzan Jun 04 '19 at 14:17

1 Answers1

1

I finally used the answer of Stéphane Laurent, you simply have to put this in your server part:

autoInvalidate <- reactiveTimer(59000)
  observe({
    autoInvalidate()
    cat(".")
  })

The number in reactiveTimer is the number of milisecond : here a point is display each 59 second.

Forzan
  • 117
  • 11