Skip to content

Commit

Permalink
set maxworkers on threads
Browse files Browse the repository at this point in the history
  • Loading branch information
emcf committed Aug 29, 2024
1 parent afc35e5 commit 9f41c9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thepipe/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def process_page(page_num):
except Exception as e:
raise ValueError(f"{e} (unable to read LLM response: {response})")

with concurrent.futures.ThreadPoolExecutor() as executor:
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
futures = [executor.submit(process_page, page_num) for page_num in range(num_pages)]
page_results = OrderedDict()
for future in concurrent.futures.as_completed(futures):
Expand Down

0 comments on commit 9f41c9b

Please sign in to comment.