feat: configurable exec timeout per request (--timeout flag, default 30s)
This commit is contained in:
parent
1c0af1693b
commit
537ed95a3c
5 changed files with 44 additions and 17 deletions
|
|
@ -392,8 +392,7 @@ async fn handle_message(
|
|||
ClientMessage::Ack { request_id }
|
||||
}
|
||||
|
||||
ServerMessage::ExecRequest { request_id, command } => {
|
||||
// Truncate long commands for display
|
||||
ServerMessage::ExecRequest { request_id, command, timeout_ms } => {
|
||||
let cmd_display = if command.len() > 60 {
|
||||
format!("{}…", &command[..60])
|
||||
} else {
|
||||
|
|
@ -401,7 +400,7 @@ async fn handle_message(
|
|||
};
|
||||
log_cmd!("exec › {}", cmd_display);
|
||||
let mut sh = shell.lock().await;
|
||||
match sh.run(&command).await {
|
||||
match sh.run(&command, timeout_ms).await {
|
||||
Ok((stdout, stderr, exit_code)) => {
|
||||
let out = stdout.trim().lines().next().unwrap_or("").to_string();
|
||||
let out_display = if out.len() > 60 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue