Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: timeout error on window and linux

Vanalitead3075231c3f
diff --git a/src-tauri/src/core/openclaw/sandbox_direct.rs b/src-tauri/src/core/openclaw/sandbox_direct.rs
index c850d42ba..086ec9105 100644
--- a/src-tauri/src/core/openclaw/sandbox_direct.rs
+++ b/src-tauri/src/core/openclaw/sandbox_direct.rs
@@ -102,10 +102,9 @@ impl Sandbox for DirectProcessSandbox {
Ok(SandboxHandle::Named("direct-process".to_string()))
} else {
- // Service registration failed (e.g. Windows without admin).
- // Fall back to `openclaw gateway` as a child process.
log::info!("Service install unavailable, starting gateway as child process");
let mut cmd = build_openclaw_command(&["gateway"], &config.config_dir);
+ cmd.stdout(Stdio::null()).stderr(Stdio::null());
for (key, value) in &config.env_vars {
cmd.env(key, value);
}
@@ -142,10 +141,8 @@ impl Sandbox for DirectProcessSandbox {
let mut stopped_via_cli = false;
let config_dir = super::get_openclaw_config_dir().unwrap_or_else(|_| std::path::PathBuf::from("."));
let mut stop_cmd = build_openclaw_command(&["gateway", "stop"], &config_dir);
- if let Ok(mut child) = stop_cmd.spawn() {
- if let Ok(status) = child.wait().await {
- stopped_via_cli = status.success();
- }
+ if let Ok(output) = stop_cmd.output().await {
+ stopped_via_cli = output.status.success();
}
if !stopped_via_cli {
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 8611445e8..94be650bc 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -160,6 +160,7 @@ pub fn run() {
core::openclaw::commands::openclaw_start,
core::openclaw::commands::openclaw_stop,
core::openclaw::commands::openclaw_status,
+ core::openclaw::commands::openclaw_check_gateway,
core::openclaw::commands::openclaw_restart,
core::openclaw::commands::openclaw_get_config_dir,
core::openclaw::commands::openclaw_ensure_jan_origin,