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

Method reconcile_snapshot_sandbox

crates/openshell-server/src/compute/mod.rs:1417–1445  ·  view source on GitHub ↗
(
        &self,
        snapshot: DriverSandbox,
        sweep_started_at_ms: i64,
    )

Source from the content-addressed store, hash-verified

1415 }
1416
1417 async fn reconcile_snapshot_sandbox(
1418 &self,
1419 snapshot: DriverSandbox,
1420 sweep_started_at_ms: i64,
1421 ) -> Result<(), String> {
1422 let _guard = self.sync_lock.lock().await;
1423 let Some(existing) = self
1424 .store
1425 .get(Sandbox::object_type(), &snapshot.id)
1426 .await
1427 .map_err(|e| e.to_string())?
1428 else {
1429 return Ok(());
1430 };
1431
1432 if existing.updated_at_ms > sweep_started_at_ms {
1433 return Ok(());
1434 }
1435
1436 let Some(current) = self
1437 .get_driver_sandbox(&snapshot.id, &snapshot.name)
1438 .await?
1439 else {
1440 return Ok(());
1441 };
1442
1443 self.apply_sandbox_update_locked(current, Some(existing))
1444 .await
1445 }
1446
1447 async fn prune_missing_sandbox(
1448 &self,

Callers 1

Calls 3

get_driver_sandboxMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected