MCPcopy Create free account
hub / github.com/bajrangCoder/acodex_server / save_cache

Method save_cache

src/updates.rs:59–73  ·  view source on GitHub ↗
(version: &str)

Source from the content-addressed store, hash-verified

57 }
58
59 async fn save_cache(version: &str) -> tokio::io::Result<()> {
60 if let Some(cache_path) = Self::get_cache_path() {
61 if let Some(parent) = cache_path.parent() {
62 fs::create_dir_all(parent).await?;
63 }
64
65 let now = SystemTime::now()
66 .duration_since(SystemTime::UNIX_EPOCH)
67 .unwrap()
68 .as_secs();
69 let content = format!("{now},{version}");
70 fs::write(cache_path, content).await?;
71 }
72 Ok(())
73 }
74
75 fn get_cache_path() -> Option<PathBuf> {
76 match std::env::var_os("HOME") {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected