INNER CODE UNIT · Rust
Some
EricLBuehler/mistral.rs · mistralrs-code-exec/src/lib.rs:219
if let Some(existing) = map.get(session_id) {
return Ok(Arc::clone(existing));
}
let session = PythonSession::new(
&self.python_path,
&self.executor_script,
self.timeout,
self.working_directory.as_deref(),
Arc::clone(&self.sandbox),
self.sandbox_policy.clone(),
)
.await?;
let arc = Arc::new(Mutex::new(session));
map.insert(session_id.to_string(), Arc::clone(&arc));
Ok(arc)
}
}