feat: add progress indicator to repository check loop#9476
Open
sagar-h007 wants to merge 6 commits into
Open
Conversation
Repository.check() can run for a long time on large repositories without any visible progress. Add a simple progress indicator to show ongoing activity while objects are being verified. Avoid computing totals with store.list(), since that could be slow for large or remote repositories. fix: borgbackup#9443
ThomasWaldmann
requested changes
Mar 13, 2026
Member
ThomasWaldmann
left a comment
There was a problem hiding this comment.
Thanks for the PR, some feedback.
|
- rename ProgressIndicatorCounter and JSON_TYPE - update message to "Checked objects: %d" - ensure pi.finish() before early break - enable progress output only with --progress
Member
|
@sagar-h007 did you see my feedback? |
ThomasWaldmann
requested changes
Mar 19, 2026
Member
ThomasWaldmann
left a comment
There was a problem hiding this comment.
A hint how to deal with api versioning.
ThomasWaldmann
requested changes
Mar 22, 2026
Guard pi init, show(), and finish() behind progress flag.
Comment on lines
+66
to
71
| if current is not None: | ||
| self.counter = current | ||
| if hasattr(self, 'counter'): | ||
| self.counter += increase | ||
| current = self.counter | ||
| if current is not None and current >= self.trigger_at: |
Member
There was a problem hiding this comment.
initialize self.counter = 0 in init method, so you don't need that hasattr.
also, move the code that is not related to producing output to a progress method as you see in the percent pi.
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.
Description
This PR adds a simple progress indicator to the Repository.check() loop.
Running borg check on large repositories can take a long time while objects are verified, but currently there is no visible progress apart from periodic key checkpoint logs. This can make it difficult to tell whether the process is still working or has stalled.
This change adds a lightweight progress indicator that reports ongoing activity as objects are processed.
Following the maintainer’s suggestion, this does not compute totals using store.list(), since that could be slow for large or remote repositories. Instead, it only shows ongoing progress without percentage or ETA.
Fixes #9443
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)