mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Relocate creation of Templar in process_pending_results
Moving it to after the blocks where per-item results are calculated, as it's not used there and causes quite a performance hit being there. Fixes #21340
This commit is contained in:
parent
c9f6a2b740
commit
7bf56ceee3
1 changed files with 5 additions and 5 deletions
|
@ -332,11 +332,6 @@ class StrategyBase:
|
|||
else:
|
||||
loop_var = 'item'
|
||||
|
||||
# get the vars for this task/host pair, make them the active set of vars for our templar above
|
||||
task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, host=original_host, task=original_task)
|
||||
self.add_tqm_variables(task_vars, play=iterator._play)
|
||||
templar.set_available_variables(task_vars)
|
||||
|
||||
# send callbacks for 'non final' results
|
||||
if '_ansible_retry' in task_result._result:
|
||||
self._tqm.send_callback('v2_runner_retry', task_result)
|
||||
|
@ -353,6 +348,11 @@ class StrategyBase:
|
|||
self._tqm.send_callback('v2_runner_item_on_ok', task_result)
|
||||
continue
|
||||
|
||||
# get the vars for this task/host pair, make them the active set of vars for our templar above
|
||||
task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, host=original_host, task=original_task)
|
||||
self.add_tqm_variables(task_vars, play=iterator._play)
|
||||
templar.set_available_variables(task_vars)
|
||||
|
||||
run_once = templar.template(original_task.run_once)
|
||||
if original_task.register:
|
||||
host_list = self.get_task_hosts(iterator, original_host, original_task)
|
||||
|
|
Loading…
Reference in a new issue