Browse Source

Kill the timer process if it doesn't properly terminate.

Ben Muthalaly 10 months ago
parent
commit
9f4cf0a8e1
1 changed files with 5 additions and 0 deletions
  1. 5 0
      archivebox/misc/logging_util.py

+ 5 - 0
archivebox/misc/logging_util.py

@@ -152,6 +152,11 @@ class TimedProgress:
                 except BaseException:                                           # lgtm [py/catch-base-exception]
                     pass
                 self.p.terminate()
+                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.
+                if self.p.is_alive():
+                    self.p.kill() 
                 self.p.join()