1
0
Fork 0

progress: Make end() idempotent

This fixes the double "done" text on successful interleaved sync.

Change-Id: I4f01418cb0340129a8f0a2a5835f7e3fa6a6b119
This commit is contained in:
Gavin Mak 2025-06-26 18:08:34 +00:00
parent 99b5a17f2c
commit 6da8a6dc80

View file

@ -101,6 +101,7 @@ class Progress:
self._units = units self._units = units
self._elide = elide and _TTY self._elide = elide and _TTY
self._quiet = quiet self._quiet = quiet
self._ended = False
# Only show the active jobs section if we run more than one in parallel. # Only show the active jobs section if we run more than one in parallel.
self._show_jobs = False self._show_jobs = False
@ -211,6 +212,10 @@ class Progress:
self.update(inc=0) self.update(inc=0)
def end(self): def end(self):
if self._ended:
return
self._ended = True
self._update_event.set() self._update_event.set()
if not _TTY or IsTraceToStderr() or self._quiet: if not _TTY or IsTraceToStderr() or self._quiet:
return return