mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-20 07:40:58 +00:00
Construct the multiprocessing manager only once.
This commit is contained in:
@@ -54,6 +54,7 @@ multiprocessing_runner = None
|
||||
|
||||
OUTPUT_LOCKFILE = tempfile.TemporaryFile()
|
||||
PROCESS_LOCKFILE = tempfile.TemporaryFile()
|
||||
MULTIPROCESSING_MANAGER = multiprocessing.Manager()
|
||||
|
||||
################################################
|
||||
|
||||
@@ -813,7 +814,7 @@ class Runner(object):
|
||||
def _parallel_exec(self, hosts):
|
||||
''' handles mulitprocessing when more than 1 fork is required '''
|
||||
|
||||
manager = multiprocessing.Manager()
|
||||
manager = MULTIPROCESSING_MANAGER
|
||||
job_queue = manager.Queue()
|
||||
for host in hosts:
|
||||
job_queue.put(host)
|
||||
|
||||
Reference in New Issue
Block a user