Streamlit hangs after a while


I have code that performs intensive computation and iterates over a user selected number of simulation points, and have a progress bar. This can easily take any where from 5-30 minutes based on how many points the user selects. The user clicks a button to start the computation, but when s(he) returns back to the streamit tab, the progress bar simply β€œhangs”. Does streamlit expects the user to consistently interact with the interface and otherwise disconnects if there is no interaction after β€œx” minutes? If yes, how do we fix this for use cases that require long computation times?

This behavior happens in both desktop and streamlit cloud.

We have a nice guide, on how to resolve an issue. This might help you and us address the problem.