Repository navigation
Fold the home-page prewarm into the page warmer - #139
Merged
Merged
Conversation
pages/home.py started its own prewarm thread at import, which raced the page warmer for the GIL while both built the same per-market frames. On the VPS after the 2026-09-25 16:17 restart the home prewarm and the queued weekly-report requests all finished together ~3.5 minutes after boot. Now home.warm_caches runs inside main.warm_page_caches, second, after the newest weekly report and before the boards. That also means it only runs in the process that serves requests (the import ran it in both under --debug's reloader), and it is re-warmed after a new week, where before a release left the home cards cold until the first visitor. Local boot, process start to served: newest weekly page 3.2s -> 2.0s, home prewarm 2.7s -> 1.0s, everything warm ~10s either way (two runs each). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
pages/home.pystarted its own prewarm thread at import. That thread raced the page warmer for the GIL while both built the same per-market frames. After the 2026-09-25 16:17 restart on the VPS, the home prewarm and the queued weekly-report requests all finished together, about 3.5 minutes after boot (see #137).Change
home._prewarm_cachebecomeshome.warm_caches(), and the import-time thread is gone.main.warm_page_cachescalls it second: after the newest weekly report, before crowd, heatmap and divergence.--debug's reloader the import used to run it in both processes.db_time). Before, a release left them cold until the first visitor.Measured (local, real stores, two runs each, from process start)
Tests
pytest tests/gives 897 passed, andruff check src testsis clean.test_warm_order.pynow pins weekly, home, crowd, heatmap, divergence.🤖 Generated with Claude Code