better handling of stalled/overfilled tasks
This commit is contained in:
parent
4cf9fb137b
commit
ad995b0845
10
impatient
10
impatient
|
@ -2,6 +2,7 @@
|
|||
|
||||
import argparse
|
||||
import datetime
|
||||
import math
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
@ -94,8 +95,13 @@ while True:
|
|||
fraction = current / final
|
||||
value_remaining = final - current
|
||||
print(' - {} total - {:.1f}% complete'.format(display_value(final), 100*fraction), end='')
|
||||
if rate > 0:
|
||||
time_remaining = datetime.timedelta(seconds=(value_remaining / rate))
|
||||
seconds_remaining = (value_remaining / rate) if rate > 0 else math.inf
|
||||
if seconds_remaining < 0:
|
||||
print(' - unknown time remaining', end='')
|
||||
elif seconds_remaining > 864000:
|
||||
print(' - stalled', end='')
|
||||
else:
|
||||
time_remaining = datetime.timedelta(seconds=seconds_remaining)
|
||||
eta = datetime.datetime.now() + time_remaining
|
||||
print(' - {} remaining - ETA {}'.format(
|
||||
display_timedelta(time_remaining),
|
||||
|
|
Loading…
Reference in a new issue