Skip to content

Commit 6cf9ed7

Browse files
committed
[WIP] progress bar updates and re rendering
1 parent ca8dddc commit 6cf9ed7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pyhdtoolkit/scripts/htc_monitor.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,21 @@ def main(
181181
progress.reset(task_id)
182182
progress.update(task_id, total=wait, completed=0)
183183

184-
# We start rendering
184+
# We start rendering our layout with progress + table
185+
live.update(make_layout(progress, table))
186+
187+
# Now we need to update the progress bar until we have
188+
# waited long enough for the next query
189+
start: float = time.monotonic()
190+
while not progress.finished:
191+
elapsed: float = time.monotonic() - start
192+
progress.update(task_id, completed=min(elapsed, wait))
193+
194+
# Refresh the live display for the progress bar
195+
live.update(make_layout(progress, table))
196+
197+
# And sleep a little
198+
time.sleep(refresh)
185199

186200
# In case the 'condor_q' command failed
187201
except CondorQError as err:

0 commit comments

Comments
 (0)