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

This commit is contained in:
2026-09-08 23:05:29 +08:00
parent f72d8a4403
commit b84c1a0f2e
5 changed files with 221 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)
}