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

Method _replace_with_retry

app/storage/json_store.py:68–82  ·  view source on GitHub ↗
(self, temp_path: Path)

Source from the content-addressed store, hash-verified

66 self._replace_with_retry(temp_path)
67
68 def _replace_with_retry(self, temp_path: Path) -> None:
69 last_error: PermissionError | None = None
70 for delay in (*self._replace_retry_delays, 0):
71 try:
72 temp_path.replace(self.path)
73 return
74 except PermissionError as exc:
75 last_error = exc
76 if delay <= 0:
77 break
78 time.sleep(delay)
79 if last_error is not None:
80 raise PermissionError(
81 f"{last_error}. atomic replace failed after retries for {self.path}"
82 ) from last_error

Callers 1

_write_unlockedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected