Skip to content

Commit 37c0ea7

Browse files
authored
Kill the timer process if it doesn't properly terminate. (ArchiveBox#1649)
2 parents 12f109b + 71c02ca commit 37c0ea7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

archivebox/misc/logging_util.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ def end(self):
152152
except BaseException: # lgtm [py/catch-base-exception]
153153
pass
154154
self.p.terminate()
155-
self.p.join()
155+
time.sleep(0.1)
156+
# sometimes the timer doesn't terminate properly, then blocks at the join until
157+
# the full time has elapsed. sending a kill tries to avoid that.
158+
try:
159+
self.p.kill()
160+
except Exception:
161+
pass
156162

157163

158164
# clear whole terminal line

0 commit comments

Comments
 (0)