change max workers to 2 for the moment (#4278)

Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
This commit is contained in:
rkuo-danswer 2025-03-13 09:58:24 -07:00 committed by GitHub
parent 39465d3104
commit ba82888e1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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