Skip to content

Commit

Permalink
repository.list: refresh lock more frequently
Browse files Browse the repository at this point in the history
under all circumstances, we must avoid that the lock
gets stale due to not being refreshed in time.

there is some internal rate limiting in _lock_refresh,
so calling it often should be no problem.
  • Loading branch information
ThomasWaldmann committed Sep 19, 2024
1 parent 97d1e18 commit 2a20ebe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/borg/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,11 @@ def list(self, limit=None, marker=None):
list <limit> infos starting from after id <marker>.
each info is a tuple (id, storage_size).
"""
self._lock_refresh()
collect = True if marker is None else False
result = []
infos = self.store.list("data") # generator yielding ItemInfos
while True:
self._lock_refresh()
try:
info = next(infos)
except StoreObjectNotFound:
Expand Down

0 comments on commit 2a20ebe

Please sign in to comment.