mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-29 12:29:10 -07:00
Add variable compression option
This commit is contained in:
parent
63c47fb271
commit
efbc6054a4
5 changed files with 41 additions and 2 deletions
|
@ -28,6 +28,7 @@ import signal
|
|||
import sys
|
||||
import time
|
||||
import traceback
|
||||
import zlib
|
||||
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
|
||||
|
@ -100,7 +101,14 @@ class WorkerProcess(multiprocessing.Process):
|
|||
task = None
|
||||
try:
|
||||
debug("waiting for a message...")
|
||||
(host, task, basedir, job_vars, play_context, shared_loader_obj) = self._main_q.get()
|
||||
(host, task, basedir, zip_vars, hostvars, compressed_vars, play_context, shared_loader_obj) = self._main_q.get()
|
||||
|
||||
if compressed_vars:
|
||||
job_vars = json.loads(zlib.decompress(zip_vars))
|
||||
else:
|
||||
job_vars = zip_vars
|
||||
job_vars['hostvars'] = hostvars
|
||||
|
||||
debug("there's work to be done! got a task/handler to work on: %s" % task)
|
||||
|
||||
# because the task queue manager starts workers (forks) before the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue