mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 21:30:22 -07:00
Move queuing tasks to a background thread
This commit is contained in:
parent
9ecec6c28e
commit
b71957d6e6
8 changed files with 226 additions and 156 deletions
|
@ -181,7 +181,9 @@ class StrategyModule(StrategyBase):
|
|||
any_errors_fatal = False
|
||||
|
||||
results = []
|
||||
items_to_queue = []
|
||||
for (host, task) in host_tasks:
|
||||
|
||||
if not task:
|
||||
continue
|
||||
|
||||
|
@ -252,14 +254,20 @@ class StrategyModule(StrategyBase):
|
|||
display.debug("sending task start callback")
|
||||
|
||||
self._blocked_hosts[host.get_name()] = True
|
||||
self._queue_task(host, task, task_vars, play_context)
|
||||
items_to_queue.append((host, task, task_vars))
|
||||
self._pending_results += 1
|
||||
del task_vars
|
||||
|
||||
# if we're bypassing the host loop, break out now
|
||||
if run_once:
|
||||
break
|
||||
|
||||
results += self._process_pending_results(iterator, one_pass=True)
|
||||
# FIXME: probably not required here any more with the result proc
|
||||
# having been removed, so there's no only a single result
|
||||
# queue for the main thread
|
||||
#results += self._process_pending_results(iterator, one_pass=True)
|
||||
|
||||
self._tqm.queue_multiple_tasks(items_to_queue, play_context)
|
||||
|
||||
# go to next host/task group
|
||||
if skip_rest:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue