1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-07 23:18:43 +00:00

AdHocCache: avoid divison by zero

0.01 ~ "one tick or less". ymmv.
This commit is contained in:
Marian Beermann 2017-06-18 13:32:12 +02:00
parent 308fb981c5
commit 55e1a54385

View file

@ -1060,7 +1060,7 @@ def _begin_txn(self):
assert len(self.chunks) == num_chunks
# LocalCache does not contain the manifest, either.
del self.chunks[self.manifest.MANIFEST_ID]
duration = perf_counter() - t0
duration = perf_counter() - t0 or 0.01
pi.finish()
logger.debug('AdHocCache: downloaded %d chunk IDs in %.2f s (%d requests), ~%s/s',
num_chunks, duration, num_requests, format_file_size(num_chunks * 34 / duration))