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

Method cleanup_sandbox_ssh_sessions

crates/openshell-server/src/compute/mod.rs:1390–1409  ·  view source on GitHub ↗
(&self, sandbox_id: &str)

Source from the content-addressed store, hash-verified

1388 }
1389
1390 async fn cleanup_sandbox_ssh_sessions(&self, sandbox_id: &str) {
1391 if let Ok(records) = self.store.list(SshSession::object_type(), 1000, 0).await {
1392 for record in records {
1393 if let Ok(session) = SshSession::decode(record.payload.as_slice())
1394 && session.sandbox_id == sandbox_id
1395 && let Err(e) = self
1396 .store
1397 .delete(SshSession::object_type(), session.object_id())
1398 .await
1399 {
1400 warn!(
1401 sandbox_id = %sandbox_id,
1402 session_id = %session.object_id(),
1403 error = %e,
1404 "Failed to delete SSH session during sandbox cleanup"
1405 );
1406 }
1407 }
1408 }
1409 }
1410
1411 fn cleanup_sandbox_state(&self, sandbox_id: &str) {
1412 self.tracing_log_bus.remove(sandbox_id);

Callers 1

Calls 4

as_sliceMethod · 0.80
object_idMethod · 0.80
listMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected