MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / save_last_sandbox

Function save_last_sandbox

crates/openshell-bootstrap/src/metadata.rs:278–285  ·  view source on GitHub ↗

Save the last-used sandbox name for a gateway to persistent storage.

(gateway: &str, sandbox: &str)

Source from the content-addressed store, hash-verified

276
277/// Save the last-used sandbox name for a gateway to persistent storage.
278pub fn save_last_sandbox(gateway: &str, sandbox: &str) -> Result<()> {
279 let path = last_sandbox_path(gateway)?;
280 ensure_parent_dir_restricted(&path)?;
281 std::fs::write(&path, sandbox)
282 .into_diagnostic()
283 .wrap_err_with(|| format!("failed to write last sandbox to {}", path.display()))?;
284 Ok(())
285}
286
287/// Load the last-used sandbox name for a gateway from persistent storage.
288///

Calls 2

last_sandbox_pathFunction · 0.85