do not touch db path prematurely

This commit is contained in:
Valentin Boettcher 2022-08-30 15:35:48 +02:00
parent c4bc0b4571
commit 8e2f6e764f

View file

@ -37,9 +37,8 @@ def model_db(data_path: str = "./.data"):
db_path = path / "model_data.json"
db_lock = path / "model_data.json.lock"
db_path.touch(exist_ok=True)
with FileLock(db_lock):
db_path.touch(exist_ok=True)
with db_path.open("r+") as f:
data = f.read()
db = (