Skip to content

Commit

Permalink
! prints
Browse files Browse the repository at this point in the history
  • Loading branch information
ALERTua committed Aug 5, 2024
1 parent 10ed920 commit 1e484c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rozetka/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,14 @@ def _worker(*worker_args, **worker_kwargs):
def fncs_map(tuple_of_fncs, *tuple_of_args):
workers = []
outputs = []
threads_limit = constants.THREADS_MAX
for fnc, fnc_args in zip_longest(tuple_of_fncs, tuple_of_args):
if (workers_len := len(workers)) >= constants.THREADS_MAX:
if (workers_len := len(workers)) >= threads_limit:
LOG.debug(f"Workers: {workers_len}. Waiting")
for worker_ in workers:
outputs.append(worker_.await_worker())
workers.remove(worker_)
LOG.debug(f"Done waiting")

@worker
def _worker(*worker_args):
Expand Down

0 comments on commit 1e484c3

Please sign in to comment.