MCPcopy Create free account
hub / github.com/0xMarcio/cve / save

Method save

scripts/github_client.py:59–68  ·  view source on GitHub ↗
(self, key: str, payload: Dict, *, ttl: int)

Source from the content-addressed store, hash-verified

57 return data.get("payload")
58
59 def save(self, key: str, payload: Dict, *, ttl: int) -> None:
60 path = self._path_for(key)
61 path.parent.mkdir(parents=True, exist_ok=True)
62 data = {
63 "fetched_at": isoformat(),
64 "expires_at": time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime(time.time() + ttl)),
65 "payload": payload,
66 }
67 with path.open("w", encoding="utf-8") as handle:
68 json.dump(data, handle, ensure_ascii=False, indent=2)
69
70
71@dataclass

Callers 2

_cached_searchMethod · 0.80
fetch_repo_metadataMethod · 0.80

Calls 2

_path_forMethod · 0.95
isoformatFunction · 0.90

Tested by

no test coverage detected