|
@@ -72,7 +72,12 @@ class orthancPeers:
|
|
|
time.sleep(tSleep)
|
|
|
jobStatus=self.checkJobStatus(jobId)
|
|
|
if jobStatus['State']=="Success":
|
|
|
+ print('Job succeeded')
|
|
|
return
|
|
|
+ if jobStatus['State']=="Failure":
|
|
|
+ print('Job failed')
|
|
|
+ return
|
|
|
+
|
|
|
try:
|
|
|
eta=datetime.datetime.strptime(jobStatus['EstimatedTimeOfArrival'],dateFormat)
|
|
|
except KeyError:
|
|
@@ -80,7 +85,7 @@ class orthancPeers:
|
|
|
t0=datetime.datetime.strptime(jobStatus['Timestamp'],dateFormat)
|
|
|
delta=eta-t0
|
|
|
tSleep=0.05*delta.seconds
|
|
|
- tSleep=min(tSleep,tSleepGuess)
|
|
|
+ tSleep=max(tSleep,tSleepGuess)
|
|
|
print('Working: {}/100, ETA: {} s, next check {} s'.format(jobStatus['Progress'],delta.seconds,tSleep))
|
|
|
|
|
|
|