Repository navigation
Wake the app with a headless browser, not curl - #10
Merged
Merged
Conversation
A curl request counted as success while the app slept: Streamlit answers it with 200 and its sleep page, and only a browser session counts as a visit. The job now opens the app in Chromium, presses the wake button if the sleep page shows, and fails unless the app itself loads.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The keep-awake job has reported success on every run while the app slept. A sleeping Streamlit Community Cloud app answers a plain request with 200 and its "gone to sleep" page, so the curl check passed, and a request without a browser does not count as a visit.
The job now opens the app in headless Chromium, presses Yes, get this app back up! if the sleep page shows, and passes only once the app's root element (
stApp) has rendered inside thestreamlitAppiframe. It fails if the app does not load within five minutes.The comment on the schedule now says about 12 hours instead of a few days, which is how long an app goes without a visitor before it sleeps.
Tested: a manual run on this branch passed and logged "the app loaded": https://github.com/vidit-16/DocEngine/actions/runs/36358251996. The app was awake at the time, so the wake-button path has not run in CI yet. The button's label and role match the sleep page as it looked today.