0

just ending to modularise my shiny app but i have a problem : my app is running all day long and some user come to consult it via web browser. i create a module to read csv and i call the module each 30 minutes by reactivetimer. the problem is the callmodule is within the server and every new session trig my module and re-read the data. before modularisation i put all my read.csv outside the server like here : https://shiny.rstudio.com/articles/scoping.html

refreshTimer <- reactiveTimer(1800000)#1800000ms pour 30min; timer pour relancer une importation

######### serveur #######  
  
shinyServer(function(input, output,session) {
  observe({ 
    refreshTimer()
    r$data<-callModule(module = module_import_CSV_30min, id = "module_import_CSV_30min")
  })

looking for a solution all night long but dont find it. any supposition? thanks

Ludo Vic
  • 17
  • 7
  • Is your app deployment containerised? – Limey May 05 '21 at 06:46
  • Hi limey, sorry i dont understand your question. – Ludo Vic May 05 '21 at 08:30
  • My app is running a normal rstudio and just launch app via runapp and specifiyng the port to use (5050) then all guys on my local network can acces to the app via my ip/port (rstudio connect server incomming). App is composed with ui.r server.r and many modules – Ludo Vic May 05 '21 at 08:39
  • @limey, i look for container (with using docker) and i can answers you, i dont use it. – Ludo Vic May 05 '21 at 11:16

1 Answers1

0

hi finaly i found "solution". in fact we cant use a module to import data for all session. we have to make it into a global.R on in server.R(outside the shinyserver). because modules can only called into shinyserver and every new session will call one more time the module. thanks for help.

Ludo Vic
  • 17
  • 7