From 46465d1749129880b3b3ec74b1e2d70e5c2007ff Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Wed, 22 Oct 2025 11:14:31 -0400 Subject: [PATCH] fix: shutdown hangs --- webhooks/webhook_batcher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webhooks/webhook_batcher.py b/webhooks/webhook_batcher.py index 6d9ea1f..ec0c971 100644 --- a/webhooks/webhook_batcher.py +++ b/webhooks/webhook_batcher.py @@ -196,7 +196,12 @@ class WebhookBatcher: # Shutdown the thread pool executor try: - self.executor.shutdown(wait=True, timeout=10) # Wait up to 10 seconds + # Use timeout parameter only if supported (Python 3.9+) + import sys + if sys.version_info >= (3, 9): + self.executor.shutdown(wait=True, timeout=10) # Wait up to 10 seconds + else: + self.executor.shutdown(wait=True) # No timeout for older Python versions _log("INFO", "Thread pool executor shut down successfully") except Exception as e: _log("WARNING", f"Error shutting down thread pool: {e}")