[cli] Ensure delta is >= 1 before verification speed calculation

Fixes #412
This commit is contained in:
derrod 2022-03-05 14:10:18 +01:00
parent d7360eef3e
commit 3d1042e27e

View file

@ -1176,7 +1176,7 @@ class LegendaryCLI:
percentage = (processed / total_size) * 100.0 percentage = (processed / total_size) * 100.0
num += 1 num += 1
if (delta := ((current_time := time.time()) - last_update)) > 1 or not last_processed: if (delta := ((current_time := time.time()) - last_update)) > 1 or (not last_processed and delta > 1):
last_update = current_time last_update = current_time
speed = (processed - last_processed) / 1024 / 1024 / delta speed = (processed - last_processed) / 1024 / 1024 / delta
last_processed = processed last_processed = processed