mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Construct the multiprocessing manager only once.
This commit is contained in:
parent
ceff3b6ba3
commit
1d13ec2da3
1 changed files with 2 additions and 1 deletions
|
@ -54,6 +54,7 @@ multiprocessing_runner = None
|
||||||
|
|
||||||
OUTPUT_LOCKFILE = tempfile.TemporaryFile()
|
OUTPUT_LOCKFILE = tempfile.TemporaryFile()
|
||||||
PROCESS_LOCKFILE = tempfile.TemporaryFile()
|
PROCESS_LOCKFILE = tempfile.TemporaryFile()
|
||||||
|
MULTIPROCESSING_MANAGER = multiprocessing.Manager()
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
|
|
||||||
|
@ -813,7 +814,7 @@ class Runner(object):
|
||||||
def _parallel_exec(self, hosts):
|
def _parallel_exec(self, hosts):
|
||||||
''' handles mulitprocessing when more than 1 fork is required '''
|
''' handles mulitprocessing when more than 1 fork is required '''
|
||||||
|
|
||||||
manager = multiprocessing.Manager()
|
manager = MULTIPROCESSING_MANAGER
|
||||||
job_queue = manager.Queue()
|
job_queue = manager.Queue()
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
job_queue.put(host)
|
job_queue.put(host)
|
||||||
|
|
Loading…
Reference in a new issue