unstable shiny that checks file constantly

In this code, I check if the parameter file exists (config.xlsx), if it exists I read the parameters from it and display them on shiny so the user know wich parameters he's using when he clicks on the button execute. The file might be in an other place so if the user put it back in the right place he ll get the parameters showing. This is why we re checking constantly here for the file. But this code has bugs and sometimes the file start opening on excel when shiny is running and I have other unstabilities, can you see what's wrong please.


  library(shiny)
  library(waiter)
  library(tidyverse)
  library(readxl)
  library(lubridate)
  library(excel.link)


ui <- fluidPage(
  waiter::use_waiter(),  
  # Add your image here

  verticalLayout(
    mainPanel(
      div(
        style = "width:1200px; margin:0 auto; text-align: center;",
        h3("TITLE"),
        h4("Paramètres"),
        uiOutput("mode_execution"),
        uiOutput("annee"),
        uiOutput("saison"),
        br(),
        actionButton("execute", "Lancer le Script", class = "btn"),
        br(),
        hr(style = "border: 1px solid white;"),  # Add this line for the white line
        h4("Résultat d’exécution"),
        div(
          class = "result-container",
          htmlOutput("result")
        )
      )
    )
  ),
)
)

server <- function(input, output, session) {
  # Read parameters from the Excel file
  parameter_file <- "config.xlsx"
  
  # Reactive polling to check for the file
  file_exists <- reactive({
    invalidateLater(1000, session)  # Check every second
    file.exists(parameter_file)
  })
  
  observe({
    tryCatch({
      if (file_exists()) {
        # Read parameters from the Excel file
        parametres <- xl.read.file(parameter_file, password = "pwd")
        
        for (i in 1:nrow(parametres)) {
          assign(parametres$parametre[i], parametres$valeur[i])
        }
        
        output$mode_execution <- renderUI({
          h4(paste("Mode exécution :", type_execution))
        })
        
        output$annee <- renderUI({
          h4(paste("Année :", annee))
        })
        
        output$saison <- renderUI({
          h4(paste("Saison :", saison))
        })
      }
    }, error = function(e) {
      output$mode_execution <- renderUI({
        h4("")
      })
      
      output$annee <- renderUI({
        h4("")
      })
      
      output$saison <- renderUI({
        h4("")
      })
    })
  })
  
  
  observeEvent(input$execute, {
    output$result <- renderUI({
      waiter <- waiter::Waiter$new(
        html = tagList(
          spin_3(),  
          h3("Script en cours d'exécution...")  
        ),
        color = "#F37021"
      )
      waiter$show()
      on.exit(waiter$hide(), add = TRUE)
      
      tryCatch(
        {
          source("important_script.R")
        },
        error = function(e) {
         
            error_exist <<- T
          }
        }
      )
      
      
      tagList(
 
          HTML(paste0("<span style='color: green; font-size: 16px; line-height: 1.5;'>L'exécution a été terminée avec succès</span>"))
        }
      )
    })
  })
}

# Run the application 
shinyApp(ui = ui, server = server)

It might help your post to list what they are.