progress thresold removed as Marek suggested

This commit is contained in:
donoban 2018-10-22 22:12:46 +02:00
parent 61c6288391
commit a2db90f85f
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5

View File

@ -326,7 +326,6 @@ class Backup(object):
#: callback for progress reporting. Will be called with one argument
#: - progress in percents
self.progress_callback = None
self.last_progress = 0
self.last_progress_time = time.time()
#: backup ID, needs to be unique (for a given user),
#: not necessary unpredictable; automatically generated
@ -518,11 +517,9 @@ class Backup(object):
progress = (
100 * (self._done_vms_bytes + self._current_vm_bytes) /
self.total_backup_bytes)
if progress - self.last_progress >= 0.5:
self.last_progress = progress
self.last_progress_time = time.time()
# pylint: disable=not-callable
self.progress_callback(progress)
self.last_progress_time = time.time()
# pylint: disable=not-callable
self.progress_callback(progress)
def _add_vm_progress(self, bytes_done):
self._current_vm_bytes += bytes_done