From 8f61b2a670b9a66512b57ca4a278b522899a7991 Mon Sep 17 00:00:00 2001 From: zhuzhongshu123 Date: Mon, 16 Dec 2024 15:09:50 +0800 Subject: [PATCH] fix(common): load existing zodb checkpoints --- kag/common/checkpointer/bin_checkpointer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kag/common/checkpointer/bin_checkpointer.py b/kag/common/checkpointer/bin_checkpointer.py index 980917fa..ebd2a8ec 100644 --- a/kag/common/checkpointer/bin_checkpointer.py +++ b/kag/common/checkpointer/bin_checkpointer.py @@ -118,7 +118,8 @@ def open(self): storage = FileStorage(self._ckpt_file_path) db = DB(storage) with db.transaction() as conn: - conn.root.data = BTrees.OOBTree.BTree() + if not hasattr(conn.root, "data"): + conn.root.data = BTrees.OOBTree.BTree() return db def read_from_ckpt(self, key):