1
0
mirror of https://github.com/pirate/ArchiveBox.git synced 2025-08-13 18:14:24 +02:00

Kill the timer process if it doesn't properly terminate. (#1649)

This commit is contained in:
Nick Sweeting
2025-02-05 19:06:19 -05:00
committed by GitHub

View File

@@ -152,7 +152,13 @@ class TimedProgress:
except BaseException: # lgtm [py/catch-base-exception]
pass
self.p.terminate()
self.p.join()
time.sleep(0.1)
# sometimes the timer doesn't terminate properly, then blocks at the join until
# the full time has elapsed. sending a kill tries to avoid that.
try:
self.p.kill()
except Exception:
pass
# clear whole terminal line