Skip to content

Commit

Permalink
🔊Fixed track
Browse files Browse the repository at this point in the history
Should not call `remove_task` when `is_last`.
  • Loading branch information
carefree0910 committed Oct 15, 2024
1 parent ee2f40d commit 7d46493
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/toolkit/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,10 @@ def __init__(self) -> None:
self._counter = 0
self._lock = Lock()

@property
def is_last(self) -> bool:
return self._counter == 1

def init(self, disable: bool, leave: bool) -> "Progress":
self.props = ProgressProperty(disable, leave)
self._p = make_progress(leave=leave, disable=disable)
Expand Down Expand Up @@ -1685,5 +1689,5 @@ def track(
p.update(task_id, advance=1)
if update_callback is not None:
update_callback(i, p, task_id)
if not leave and not disable:
if not leave and not disable and not RC_PROGRESS.is_last:
p.remove_task(task_id)

0 comments on commit 7d46493

Please sign in to comment.