Skip to content

Commit 7c9e633

Browse files
committed
init new db json
1 parent a47f579 commit 7c9e633

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

lean_dojo_v2/database/dynamic_database.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,8 @@ def __init__(self, json_path: str = "dynamic_database.json"):
5555
self.json_path = json_path
5656
self.repositories = []
5757

58-
if not os.path.exists(self.json_path) or os.path.getsize(self.json_path) == 0:
59-
# File doesn't exist or is empty, initialize it
60-
logger.info(f"Initializing new database at {self.json_path}")
61-
self.to_json(self.json_path)
62-
else:
63-
try:
64-
self._load_from_json(self.json_path)
65-
except json.JSONDecodeError:
66-
logger.warning(
67-
f"Error decoding JSON from {self.json_path}. Initializing new database."
68-
)
69-
self.to_json(self.json_path)
58+
logger.info(f"Initializing new database at {self.json_path}")
59+
self.to_json(self.json_path)
7060

7161
SPLIT = Dict[str, List[Theorem]]
7262

0 commit comments

Comments
 (0)