Skip to content

Commit

Permalink
limit max_workers to 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Qetesh committed Aug 19, 2024
1 parent ff8e06f commit 722fbfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def process_entry(entry):
start_time = time.time()
print(time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()), 'Fetched unread entries: ' + str(len(entries['entries']))) if len(entries['entries']) > 0 else print(time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()), 'No new entries')

with concurrent.futures.ThreadPoolExecutor() as executor:
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
futures = [executor.submit(process_entry, i) for i in entries['entries']]
for future in concurrent.futures.as_completed(futures):
try:
Expand Down

0 comments on commit 722fbfc

Please sign in to comment.