From 27a927c0908d4081b5adc0869aaf93d6ef523edb Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Mon, 16 Jun 2025 18:42:39 -0400 Subject: [PATCH] Kill on drop true --- backend/src/executors/echo.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/backend/src/executors/echo.rs b/backend/src/executors/echo.rs index 12d7fc5f..fc968a5a 100644 --- a/backend/src/executors/echo.rs +++ b/backend/src/executors/echo.rs @@ -13,27 +13,33 @@ impl Executor for EchoExecutor { fn executor_type(&self) -> &'static str { "echo" } - - async fn spawn(&self, pool: &sqlx::PgPool, task_id: Uuid, _worktree_path: &str) -> Result { + + async fn spawn( + &self, + pool: &sqlx::PgPool, + task_id: Uuid, + _worktree_path: &str, + ) -> Result { // Get the task to fetch its description let task = Task::find_by_id(pool, task_id) .await? .ok_or(ExecutorError::TaskNotFound)?; - + let message = format!( "Executing task: {} - {}", task.title, task.description.as_deref().unwrap_or("No description") ); - + let child = Command::new("echo") + .kill_on_drop(true) .arg(&message) .spawn() .map_err(ExecutorError::SpawnFailed)?; - + Ok(child) } - + fn description(&self) -> &'static str { "Echoes the task title and description" }