瀏覽代碼

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

Nick Sweeting 10 月之前
父節點
當前提交
37c0ea7eba
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      archivebox/misc/logging_util.py

+ 7 - 1
archivebox/misc/logging_util.py

@@ -152,7 +152,13 @@ class TimedProgress:
                 except BaseException:                                           # lgtm [py/catch-base-exception]
                 except BaseException:                                           # lgtm [py/catch-base-exception]
                     pass
                     pass
                 self.p.terminate()
                 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
                 # clear whole terminal line