feat(sandbox): 强制执行可取消的逐工具截止时间

This commit is contained in:
2026-09-08 23:05:29 +08:00
parent a95381ca44
commit 1307f64aea
6 changed files with 231 additions and 1 deletions
+8
View File
@@ -13,6 +13,14 @@ pub struct Job {
handle: OwnedHandle,
}
impl Job {
pub(crate) fn clone_for_deadline(&self) -> Result<Self> {
Ok(Self {
handle: self
.handle
.try_clone()
.map_err(|_| HostError::new("EXTENSION_RESOURCE_UNAVAILABLE"))?,
})
}
pub fn new() -> Result<Self> {
Self::with_process_limit(16)
}