Streamlit rerun after 40 minutes

I’m developing a Streamlit app that connects to an API. Users upload a file via st.file_uploader, and based on that file, the app generates a request, processes the data, and packages the results into a ZIP file for download.

The problem is that this whole process can take quite a long time, sometimes 30 to 40 minutes. At some point during the execution, the app seems to auto-reload or restart, and everything is lost (uploaded file, progress, output).

I’ve read that Streamlit may have a 30-minute timeout related to WebSocket connections. I’m currently running the app on Hugging Face.

1 Like