Skip to content

Commit

Permalink
! threading limit tryouts seems to succeed with bullseye
Browse files Browse the repository at this point in the history
  • Loading branch information
ALERTua committed Aug 4, 2024
1 parent 9fdbbe0 commit 846d056
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions rozetka/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,6 @@ def _worker(*worker_args, **worker_kwargs):
def fncs_map(tuple_of_fncs, *tuple_of_args):
workers = []
for fnc, fnc_args in zip_longest(tuple_of_fncs, tuple_of_args):
active_workers = ThreadWorkerManager.list(active_only=True) or []
all_workers = ThreadWorkerManager.list() or []
LOG.warning(f"active workers: {len(active_workers)}, all_workers: {len(all_workers)}")

while ((active_workers := ThreadWorkerManager.list())
and ((workers_len := len(active_workers)) > constants.THREADS_MAX)):
LOG.warning(f"{workers_len} active workers. Waiting...")
ThreadWorkerManager.wait(wait_all=True)

@worker
def _worker(*worker_args):
return fnc(*worker_args)
Expand Down

0 comments on commit 846d056

Please sign in to comment.