mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-14 15:13:14 +02:00
change max workers to 2 for the moment (#4278)
Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
This commit is contained in:
@ -481,6 +481,8 @@ def _process_message(
|
|||||||
|
|
||||||
|
|
||||||
class SlackConnector(SlimConnector, CheckpointConnector):
|
class SlackConnector(SlimConnector, CheckpointConnector):
|
||||||
|
MAX_WORKERS = 2
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
channels: list[str] | None = None,
|
channels: list[str] | None = None,
|
||||||
@ -594,7 +596,7 @@ class SlackConnector(SlimConnector, CheckpointConnector):
|
|||||||
new_latest = message_batch[-1]["ts"] if message_batch else latest
|
new_latest = message_batch[-1]["ts"] if message_batch else latest
|
||||||
|
|
||||||
# Process messages in parallel using ThreadPoolExecutor
|
# 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] = []
|
futures: list[Future] = []
|
||||||
for message in message_batch:
|
for message in message_batch:
|
||||||
# Capture the current context so that the thread gets the current tenant ID
|
# Capture the current context so that the thread gets the current tenant ID
|
||||||
|
Reference in New Issue
Block a user