Uploading version when there are no users

I’m running a local served streamlit application currently used by a few users.

The users interact with the app sending an audio stream (webrtc) or a file. Then that audio is processed and return some values. The whole process could be long, at the streaming user could be sending audio for an hour, for example.

My question is how can I safely stop the application to upgrade it to the next version. I don’t want to stop it in the middle of a stream or while the user is looking at the results.

I know streamlit keeps a web socket connected with the browser so I thought won’t be difficult to track how many connections are currently established and wait till they are gone, but seems to be more complex than expected.

I can rely on “ss -antp” but don’t seem to be the best option.
I also checked if tracing in nginx or caddy could help, but it didn’t trace the web sockets (or I can’t found it).

I have seen in the forum some hacks to get the all the sessions but I want to ask before going that path, as the ability to change the version without impacting looks something many people could want.

Thanks!

Hi @adrianlzt

An easy way to see how many user connections there are for our app is to click on the “Manager app” found at the bottom right of our app (see screenshot below):

You can also see this graphically by using the “Analytics” feature in the “Manage Apps” menu:

Here’s the screenshot of our app user analytics: