mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-19 14:02:55 +00:00
Merge pull request #2992 from ThomasWaldmann/cleanup-log-1.1
add debug logging for repository cleanup
This commit is contained in:
commit
c77dd42302
1 changed files with 4 additions and 0 deletions
|
@ -1173,11 +1173,15 @@ def cleanup(self, transaction_id):
|
|||
"""Delete segment files left by aborted transactions
|
||||
"""
|
||||
self.segment = transaction_id + 1
|
||||
count = 0
|
||||
for segment, filename in self.segment_iterator(reverse=True):
|
||||
if segment > transaction_id:
|
||||
truncate_and_unlink(filename)
|
||||
count += 1
|
||||
else:
|
||||
break
|
||||
logger.debug('Cleaned up %d uncommitted segment files (== everything after segment %d).',
|
||||
count, transaction_id)
|
||||
|
||||
def is_committed_segment(self, segment):
|
||||
"""Check if segment ends with a COMMIT_TAG tag
|
||||
|
|
Loading…
Reference in a new issue