mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-07 02:07:52 +02:00
Use uuid6 as the id for checkpoints
- this avoids conflicts if multiple processes creating checkpoints in same thread at same time - uuid6 with a monotically increasing clock_seq is sortable by creation time at ms precision (plus clock_seq for ties, plus 48 bits of randomness for further ties)
This commit is contained in:
@@ -40,8 +40,8 @@ class MemorySaverAssertImmutable(MemorySaver):
|
||||
# assert checkpoint hasn't been modified since last written
|
||||
thread_id = config["configurable"]["thread_id"]
|
||||
if saved := super().get(config):
|
||||
assert self.storage_for_copies[thread_id][saved["ts"]] == saved
|
||||
self.storage_for_copies[thread_id][checkpoint["ts"]] = copy_checkpoint(
|
||||
assert self.storage_for_copies[thread_id][saved["id"]] == saved
|
||||
self.storage_for_copies[thread_id][checkpoint["id"]] = copy_checkpoint(
|
||||
checkpoint
|
||||
)
|
||||
# call super to write checkpoint
|
||||
|
||||
Reference in New Issue
Block a user