Skip to content

Commit

Permalink
Avoid copying checkpoint when fetching at beginning of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Sep 12, 2024
1 parent d669b5c commit 43ec65c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/langgraph/langgraph/pregel/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def __enter__(self) -> Self:
**saved.config.get("configurable", {}),
},
}
self.checkpoint = copy_checkpoint(saved.checkpoint)
self.checkpoint = saved.checkpoint
self.checkpoint_metadata = saved.metadata
self.checkpoint_pending_writes = (
[(str(tid), k, v) for tid, k, v in saved.pending_writes]
Expand Down Expand Up @@ -777,7 +777,7 @@ async def __aenter__(self) -> Self:
**saved.config.get("configurable", {}),
},
}
self.checkpoint = copy_checkpoint(saved.checkpoint)
self.checkpoint = saved.checkpoint
self.checkpoint_metadata = saved.metadata
self.checkpoint_pending_writes = (
[(str(tid), k, v) for tid, k, v in saved.pending_writes]
Expand Down

0 comments on commit 43ec65c

Please sign in to comment.