From 55e1a543856726a199e4931fb688135fb462bea5 Mon Sep 17 00:00:00 2001 From: Marian Beermann Date: Sun, 18 Jun 2017 13:32:12 +0200 Subject: [PATCH] AdHocCache: avoid divison by zero 0.01 ~ "one tick or less". ymmv. --- src/borg/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/cache.py b/src/borg/cache.py index 47b53deb2..fb113d93d 100644 --- a/src/borg/cache.py +++ b/src/borg/cache.py @@ -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))