mirror of
https://github.com/docker/compose.git
synced 2025-07-23 05:34:36 +02:00
Small refactor to feed_queue()
Put the event tuple into the results queue rather than yielding it from the function. Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
97467c7dec
commit
0e3db185cf
@ -87,8 +87,7 @@ def parallel_execute_stream(objects, func, get_deps):
|
|||||||
state = State(objects)
|
state = State(objects)
|
||||||
|
|
||||||
while not state.is_done():
|
while not state.is_done():
|
||||||
for event in feed_queue(objects, func, get_deps, results, state):
|
feed_queue(objects, func, get_deps, results, state)
|
||||||
yield event
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
event = results.get(timeout=0.1)
|
event = results.get(timeout=0.1)
|
||||||
@ -126,7 +125,7 @@ def feed_queue(objects, func, get_deps, results, state):
|
|||||||
|
|
||||||
if any(dep in state.failed for dep in deps):
|
if any(dep in state.failed for dep in deps):
|
||||||
log.debug('{} has upstream errors - not processing'.format(obj))
|
log.debug('{} has upstream errors - not processing'.format(obj))
|
||||||
yield (obj, None, UpstreamError())
|
results.put((obj, None, UpstreamError()))
|
||||||
state.failed.add(obj)
|
state.failed.add(obj)
|
||||||
elif all(
|
elif all(
|
||||||
dep not in objects or dep in state.finished
|
dep not in objects or dep in state.finished
|
||||||
|
Loading…
x
Reference in New Issue
Block a user