Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Nov 15, 2024
1 parent 50f3272 commit d1a8b53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/langgraph/langgraph/pregel/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ def writer(
if next_task := self.schedule_task(
task, idx, calls[idx - prev_length] if calls else None
):
# if the parent task was retried,
# the next task might already be running
if fut := next(
(
f
Expand All @@ -96,8 +94,12 @@ def writer(
),
None,
):
# if the parent task was retried,
# the next task might already be running
rtn[idx - prev_length] = fut
elif next_task.writes:
# if it already ran, return the result
# TODO we could also set the result for non-RETURN writes
fut = concurrent.futures.Future()
if val := next(v for c, v in next_task.writes if c == RETURN):
fut.set_result(val)
Expand Down

0 comments on commit d1a8b53

Please sign in to comment.