Skip to content

Commit

Permalink
Merge 34ba96c into f9575ac
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhou-JiaJun committed Jan 18, 2023
2 parents f9575ac + 34ba96c commit d8a802d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions rqalpha/utils/concurrent.py
Expand Up @@ -50,14 +50,16 @@ def __init__(self, max_workers=None, initializer=None, initargs=()):
def _adjust_process_count(self):
# noinspection PyUnresolvedReferences
for _ in range(len(self._processes), self._max_workers):
# noinspection PyUnresolvedReferences
p = multiprocessing.Process(
target=_process_worker,
args=(self._call_queue, self._result_queue, self._progress_queue, self._initializer, self._initargs)
)
p.start()
# noinspection PyUnresolvedReferences
self._processes[p.pid] = p
self._spawn_process()

def _spawn_process(self):
p = multiprocessing.Process(
target=_process_worker,
args=(self._call_queue, self._result_queue, self._progress_queue, self._initializer, self._initargs)
)
p.start()
# noinspection PyUnresolvedReferences
self._processes[p.pid] = p

def submit(self, fn, *args, **kwargs):
if isinstance(fn, ProgressedTask):
Expand Down

0 comments on commit d8a802d

Please sign in to comment.