Streamlit app hibernating even after daily repo pushes

Hi,

I am hoping to resurrect a thread from 2024, as it’s still pertinent. As @magalhaes-d said in this thread from May of last year, Streamlit Community Cloud continues to hibernate my apps, even after I have set up a daily (and in my case, twice a day) automated push to the remote repo using GitHub Actions + a .yml file.

Here is the code to my .yml file that is run twice a day by GitHub Actions. The .yml just creates a simple text file with a timestamp, stores it in the repo, then commits and pushes to the repo.

name: Add Timestamp File

on:
  schedule:
    - cron: "0 7,19 * * *" 
  workflow_dispatch: 

jobs:
  create-and-commit:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Create timestamp file
        run: |
          mkdir -p Assets
          echo "$(date)" > Assets/timestamp.txt
          cat Assets/timestamp.txt  

      - name: Commit and push changes
        uses: EndBug/add-and-commit@v9
        with:
          add: "Assets/timestamp.txt"
          message: "Automated commit: Adding timestamp file"
          push: true

When I run this GitHub action manually, I can confirm that the Streamlit app refreshes on the frontend. Here’s a link to the app.

And I’ve checked the repo and can confirm the GitHub actions is properly running every 12 hours. Incredibly, Streamlit Community Cloud still hibernates this app due to “inactivity.” Do I need to set this to run even more frequently than 12 hours to keep the app awake?

Any help would be greatly appreciated!

1 Like

This might provide some context: Web-apps keeps on sleeping after 30 minutes or a day of inactivity - #4 by SiddhantSadangi

Perfect. Thank you, @SiddhantSadangi! Do you anticipate this time threshold to continue to fall?

That’d be a question for the PMs based on the usage analytics on the Community Cloud :slight_smile:

For some context, 99.5% of visits to an app on the community cloud are less than 12 hours from the previous visit.

1 Like