MCPcopy Create free account
hub / github.com/VitoHowe/glm-coding / _read_unlocked

Method _read_unlocked

app/storage/json_store.py:44–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

42 return updated
43
44 def _read_unlocked(self) -> Any:
45 if not self.path.exists():
46 return copy.deepcopy(self.default_factory())
47
48 raw = self.path.read_bytes()
49 if not raw.strip():
50 return copy.deepcopy(self.default_factory())
51 if orjson is not None:
52 return orjson.loads(raw)
53 return json.loads(raw.decode("utf-8"))
54
55 def _write_unlocked(self, payload: Any) -> None:
56 self.path.parent.mkdir(parents=True, exist_ok=True)

Callers 2

readMethod · 0.95
updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected