The “always run” setting does not persist across ST sessions - not sure if that’s a feature. The only way to make that setting sticky is to edit the (blank in my case) toml file. Checking the “run on save” checkbox/clicking “always run” didn’t touch the toml file. Perhaps it would be easier to prepopulate the toml file with default settings as a starting point for custom config, and to then persist the “always run” setting by modifying the runOnSave line?
Just to confirm, when you choose “always rerun” via the UI the setting only lasts for that session — and this is indeed on purpose
To make the setting persist, you should add the following to the config file at ~/.streamlit/config.toml, as you noted:
[server]
runOnSave = true
The thinking behind that was that many of our early users started by taking an existing Python file which takes a long time to run and sprinkling some Streamlit magic on it. While they iterate on it they often save their work, either to make sure it doesn’t get lost if their editor crashes, or even just due to force of habit. With runOnSave turned on, while users are refactoring their script the rerun could be very CPU intensive and slow.
Or worse, many times the original script is destructive: rerunning it will overwrite some files, update a database, etc. This is something the user will likely want to fix as they convert the script to Streamlit, but while they’re still in the middle of this work it may still be an issue.
So, out of caution, we decided to default runOnSave to off and listen to the community for possible future improvements.
Hi @Andrew_Holoska, thanks for the follow up. It is not possible to set server.runOnSave in the script. We have a PR to make clear which options you can set in the script: https://github.com/streamlit/streamlit/pull/702. This has been merged and will be in the next release. For now you can set in the script only: client.displayEnabled and client.caching.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.