equivalent restart session in shiny app

I have a Rshiny script run with a cmd file, then the app opens online. there a clickable button to do calculations on the app (execute an R script); The problem is when you click many times in the button it start showing some weird behaviour. When I reopene it with cmd everything seems normal. I think this is because clicking on the button misses the "restart session" component. is " session$reload()" the solution in this case (at the beginning of shiny script)?

If you have an actionButton in Shiny that triggers a computation that takes a few seconds, and you keep clicking it repeatedly while it's still computing, you will queue up a new computation to start immediately after the current process finishes. Each time you click on it adds one more event to the queue. Click 10 times and you'll have to wait for your script to run 10 times before your app will be ready again.

Reopening the app from scratch will have stopped the existing queue and started a new process that will work normally.

To prevent a queue of jobs forming, have the action button disable at the start of your script and re-enable it when it's done.

I have a waiter showing so no click button is allowed when script is running, this is not the problem, many executions create bugs.