Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: remove superfluous repository.list() call #8411

Merged

Conversation

ThomasWaldmann
Copy link
Member

Because it ended the loop only when .list() returned an empty result, this always needed one call more than necessary.

We can also detect that we are finished, if .list() returns less than the limit we gave to it.

Also: reduce code duplication by using repo_lister func.

Because it ended the loop only when .list() returned an
empty result, this always needed one call more than
necessary.

We can also detect that we are finished, if .list()
returns less than the limit we gave to it.

Also: reduce code duplication by using repo_lister func.
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 51.21951% with 20 lines in your changes missing coverage. Please review.

Project coverage is 81.54%. Comparing base (36e3d63) to head (1436bbb).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/archiver/debug_cmd.py 18.18% 18 Missing ⚠️
src/borg/repository.py 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8411   +/-   ##
=======================================
  Coverage   81.54%   81.54%           
=======================================
  Files          70       70           
  Lines       12791    12775   -16     
  Branches     2318     2317    -1     
=======================================
- Hits        10431    10418   -13     
+ Misses       1703     1699    -4     
- Partials      657      658    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann ThomasWaldmann merged commit 67b62b5 into borgbackup:master Sep 25, 2024
15 of 16 checks passed
@ThomasWaldmann ThomasWaldmann deleted the optimize-repo-list-usage branch September 25, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant