mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Reduce spinning while waiting on queues
This commit is contained in:
@@ -73,11 +73,11 @@ class ResultProcess(multiprocessing.Process):
|
||||
try:
|
||||
if not rslt_q.empty():
|
||||
debug("worker %d has data to read" % self._cur_worker)
|
||||
result = rslt_q.get()
|
||||
result = rslt_q.get(block=False)
|
||||
debug("got a result from worker %d: %s" % (self._cur_worker, result))
|
||||
break
|
||||
except queue.Empty:
|
||||
pass
|
||||
time.sleep(0.01)
|
||||
|
||||
if self._cur_worker == starting_point:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user