feat: Enhance executable resolution by refreshing PATH (#1098)
* Refresh path on executable lookup * Make resolve_executable_path async * Handle task attempt start failure gracefully * clippy fix * Remove unused to_shell_string * Lint --------- Co-authored-by: Alex Netsch <alex@bloop.ai>
This commit is contained in:
@@ -169,10 +169,13 @@ pub async fn create_task_attempt(
|
||||
)
|
||||
.await?;
|
||||
|
||||
let execution_process = deployment
|
||||
if let Err(err) = deployment
|
||||
.container()
|
||||
.start_attempt(&task_attempt, executor_profile_id.clone())
|
||||
.await?;
|
||||
.await
|
||||
{
|
||||
tracing::error!("Failed to start task attempt: {}", err);
|
||||
}
|
||||
|
||||
deployment
|
||||
.track_if_analytics_allowed(
|
||||
@@ -186,7 +189,7 @@ pub async fn create_task_attempt(
|
||||
)
|
||||
.await;
|
||||
|
||||
tracing::info!("Started execution process {}", execution_process.id);
|
||||
tracing::info!("Created attempt for task {}", task.id);
|
||||
|
||||
Ok(ResponseJson(ApiResponse::success(task_attempt)))
|
||||
}
|
||||
|
||||
@@ -180,10 +180,12 @@ pub async fn create_task_and_start(
|
||||
task.id,
|
||||
)
|
||||
.await?;
|
||||
let execution_process = deployment
|
||||
let is_attempt_running = deployment
|
||||
.container()
|
||||
.start_attempt(&task_attempt, payload.executor_profile_id.clone())
|
||||
.await?;
|
||||
.await
|
||||
.inspect_err(|err| tracing::error!("Failed to start task attempt: {}", err))
|
||||
.is_ok();
|
||||
deployment
|
||||
.track_if_analytics_allowed(
|
||||
"task_attempt_started",
|
||||
@@ -200,10 +202,10 @@ pub async fn create_task_and_start(
|
||||
.await?
|
||||
.ok_or(ApiError::Database(SqlxError::RowNotFound))?;
|
||||
|
||||
tracing::info!("Started execution process {}", execution_process.id);
|
||||
tracing::info!("Started attempt for task {}", task.id);
|
||||
Ok(ResponseJson(ApiResponse::success(TaskWithAttemptStatus {
|
||||
task,
|
||||
has_in_progress_attempt: true,
|
||||
has_in_progress_attempt: is_attempt_running,
|
||||
has_merged_attempt: false,
|
||||
last_attempt_failed: false,
|
||||
executor: task_attempt.executor,
|
||||
|
||||
Reference in New Issue
Block a user