From b5ad13426414bb800d504cc0078aacfbaa463566 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sun, 12 May 2024 19:25:55 -0700 Subject: [PATCH] dont wait for ipython history saver thread before shell exit --- archivebox/cli/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/archivebox/cli/__init__.py b/archivebox/cli/__init__.py index 169e8bdd..204267d7 100644 --- a/archivebox/cli/__init__.py +++ b/archivebox/cli/__init__.py @@ -37,7 +37,10 @@ is_valid_cli_module = lambda module, subcommand: ( ) -def wait_for_bg_threads_to_exit(thread_names: Iterable[str]=(), ignore_names: Iterable[str]=('MainThread', 'ThreadPoolExecutor'), timeout: int=60) -> int: +IGNORED_BG_THREADS = ('MainThread', 'ThreadPoolExecutor', 'IPythonHistorySavingThread') # threads we dont have to wait for before exiting + + +def wait_for_bg_threads_to_exit(thread_names: Iterable[str]=(), ignore_names: Iterable[str]=IGNORED_BG_THREADS, timeout: int=60) -> int: """ Block until the specified threads exit. e.g. pass thread_names=('default_hook_handler',) to wait for webhooks. Useful for waiting for signal handlers, webhooks, etc. to finish running after a mgmt command completes.