mirror of https://github.com/dapr/quickstarts.git
Update tutorials/workflow/python/fan-out-fan-in/fan_out_fan_in/fanoutfanin_workflow.py
Co-authored-by: Dzvezdana Arsovska <arsovska93@gmail.com> Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
This commit is contained in:
parent
376a7ca850
commit
2f105b2c6b
|
@ -16,8 +16,7 @@ def fanoutfanin_workflow(ctx: wf.DaprWorkflowContext, words: List[str]):
|
|||
ctx.call_activity(get_word_length, input=word) for word in words
|
||||
]
|
||||
all_word_lengths = yield wf.when_all(tasks)
|
||||
sorted_word_lengths = sorted(all_word_lengths, key=lambda x: x.length)
|
||||
shortest_word = sorted_word_lengths[0]
|
||||
shortest_word = min(all_word_lengths, key=lambda x: x.length)
|
||||
return shortest_word.word
|
||||
|
||||
@wf_runtime.activity(name='get_word_length')
|
||||
|
|
Loading…
Reference in New Issue