MCPcopy Create free account
hub / github.com/ResearAI/DeepReviewer-v2 / write_json_atomic

Function write_json_atomic

deepreview/storage.py:48–52  ·  view source on GitHub ↗
(path: Path, payload: dict[str, Any])

Source from the content-addressed store, hash-verified

46
47
48def write_json_atomic(path: Path, payload: dict[str, Any]) -> None:
49 path.parent.mkdir(parents=True, exist_ok=True)
50 tmp = path.with_suffix(path.suffix + '.tmp')
51 tmp.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding='utf-8')
52 tmp.replace(path)
53
54
55def write_text_atomic(path: Path, content: str) -> None:

Callers 5

run_job_asyncFunction · 0.90
persist_annotationsMethod · 0.90
save_job_stateFunction · 0.85
update_job_stateFunction · 0.85
mutate_job_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected