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}")