Skip to content

Commit

Permalink
AsyncDDGS()._get_executor(max_workers=1), because >=2 lead to a big o…
Browse files Browse the repository at this point in the history
…verhead
  • Loading branch information
deedy5 committed Mar 14, 2024
1 parent e400583 commit 2346f7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions duckduckgo_search/duckduckgo_search_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def _get_parser(self) -> html.HTMLParser:
)
return self._parser

def _get_executor(self, workers: int = 10) -> ThreadPoolExecutor:
"""Get ThreadPoolExecutor."""
def _get_executor(self, max_workers: int = 1) -> ThreadPoolExecutor:
"""Get ThreadPoolExecutor. Default max_workers=1, because >=2 leads to a big overhead"""
if self._executor is None:
self._executor = ThreadPoolExecutor(max_workers=workers)
self._executor = ThreadPoolExecutor(max_workers=max_workers)
return self._executor

async def _aget_url(
Expand Down

0 comments on commit 2346f7b

Please sign in to comment.