From 60560b884bc8a89b0330c2e61f999a1add1a725c Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Sat, 19 Feb 2022 18:10:10 +0100 Subject: [PATCH] cleaned up progress stuff --- zfs_autobackup/ZfsDataset.py | 2 +- zfs_autobackup/ZfsNode.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/zfs_autobackup/ZfsDataset.py b/zfs_autobackup/ZfsDataset.py index 83b120a..e47ba12 100644 --- a/zfs_autobackup/ZfsDataset.py +++ b/zfs_autobackup/ZfsDataset.py @@ -637,7 +637,7 @@ class ZfsDataset: else: valid_exitcodes = [0] - self.zfs_node.reset_progress() + # self.zfs_node.reset_progress() self.zfs_node.run(cmd, inp=pipe, valid_exitcodes=valid_exitcodes) # invalidate cache, but we at least know we exist now diff --git a/zfs_autobackup/ZfsNode.py b/zfs_autobackup/ZfsNode.py index 7142d0a..a9fdd60 100644 --- a/zfs_autobackup/ZfsNode.py +++ b/zfs_autobackup/ZfsNode.py @@ -109,10 +109,10 @@ class ZfsNode(ExecuteNode): return self.__datasets.setdefault(name, ZfsDataset(self, name, force_exists)) - def reset_progress(self): - """reset progress output counters""" - self._progress_total_bytes = 0 - self._progress_start_time = time.time() + # def reset_progress(self): + # """reset progress output counters""" + # self._progress_total_bytes = 0 + # self._progress_start_time = time.time() def parse_zfs_progress(self, line, hide_errors, prefix): """try to parse progress output of zfs recv -Pv, and don't show it as error to the user """ @@ -132,13 +132,13 @@ class ZfsNode(ExecuteNode): # actual useful info if len(progress_fields) >= 3: if progress_fields[0] == 'full' or progress_fields[0] == 'size': - # Reset the total bytes and start the timer again (otherwise the MB/s - # counter gets confused) + # Reset the total bytes and start the timer again (otherwise the MB/s + # counter gets confused) self._progress_total_bytes = int(progress_fields[2]) self._progress_start_time = time.time() elif progress_fields[0] == 'incremental': - # Reset the total bytes and start the timer again (otherwise the MB/s - # counter gets confused) + # Reset the total bytes and start the timer again (otherwise the MB/s + # counter gets confused) self._progress_total_bytes = int(progress_fields[3]) self._progress_start_time = time.time() elif progress_fields[1].isnumeric():