From ba82888e1ed7b6f5ab23371337f99c7e288dab40 Mon Sep 17 00:00:00 2001 From: rkuo-danswer Date: Thu, 13 Mar 2025 09:58:24 -0700 Subject: [PATCH] change max workers to 2 for the moment (#4278) Co-authored-by: Richard Kuo (Onyx) --- backend/onyx/connectors/slack/connector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/onyx/connectors/slack/connector.py b/backend/onyx/connectors/slack/connector.py index ff6ea80c7..2ef36b954 100644 --- a/backend/onyx/connectors/slack/connector.py +++ b/backend/onyx/connectors/slack/connector.py @@ -481,6 +481,8 @@ def _process_message( class SlackConnector(SlimConnector, CheckpointConnector): + MAX_WORKERS = 2 + def __init__( self, channels: list[str] | None = None, @@ -594,7 +596,7 @@ class SlackConnector(SlimConnector, CheckpointConnector): new_latest = message_batch[-1]["ts"] if message_batch else latest # Process messages in parallel using ThreadPoolExecutor - with ThreadPoolExecutor(max_workers=8) as executor: + with ThreadPoolExecutor(max_workers=SlackConnector.MAX_WORKERS) as executor: futures: list[Future] = [] for message in message_batch: # Capture the current context so that the thread gets the current tenant ID