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
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.