Repository navigation
feat: share each fetch for 10 seconds between the prtops running at once - #17
Merged
Merged
Conversation
TomyCesaille
marked this pull request as ready for review
October 28, 2026 08:03
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.
Closes #16.
Shared fetch (
fetch_reportinprtop/cli.py,prtop/state.py): every fetch saves its report toreport.jsonin the state directory. That covers the live view, a one-shot table andprtop watch. The save carries the settings the fetch ran under (repr(config)) and the time it came back. A prtop about to fetch less than 10 seconds later (FRESH_FOR), under the same settings, shows that report instead of callingglaborgh.-d, as the issue proposed. The lag stays under 10 s whatever the loops' delays, and a closed or paused live view never leaves a watch reading an old table.<host>.json. Only the fetch that called the forges does.-dunder 10, shows that fetch again.--demoneither reads nor saves.examples/claude-code/CLAUDE.mddrops the advice to skip the watch whileprtopis open.Tried with a fake
glabandghthat log every call: a secondprtopright after the first logged 0 calls, and a third 10.5 s later fetched again.