mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-28 04:03:21 -04:00
compact: derive freed space from quota use before/after, fixes #5679
due to the way quota accounting is done, this is likely not 100% precise, but much better than selling the hints as the truth. Backport notes: 1.1 did not report how much space was freed so I have added the message.
This commit is contained in:
parent
2b3217121f
commit
57475f4b72
1 changed files with 3 additions and 0 deletions
|
|
@ -725,6 +725,7 @@ class Repository:
|
|||
"""
|
||||
if not self.compact:
|
||||
return
|
||||
quota_use_before = self.storage_quota_use
|
||||
index_transaction_id = self.get_index_transaction_id()
|
||||
segments = self.segments
|
||||
unused = [] # list of segments, that are not used anymore
|
||||
|
|
@ -847,6 +848,8 @@ class Repository:
|
|||
pi.show()
|
||||
pi.finish()
|
||||
complete_xfer(intermediate=False)
|
||||
quota_use_after = self.storage_quota_use
|
||||
logger.info('compaction freed about %s repository space.', format_file_size(quota_use_before - quota_use_after))
|
||||
logger.debug('compaction completed.')
|
||||
|
||||
def replay_segments(self, index_transaction_id, segments_transaction_id):
|
||||
|
|
|
|||
Loading…
Reference in a new issue