mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 00:02:19 +00:00
fix: improve docker logs collection in docker mode
This commit is contained in:
@@ -372,6 +372,7 @@ async fn handle_docker_job(
|
||||
.await;
|
||||
loop {
|
||||
tokio::select! {
|
||||
biased;
|
||||
log = log_stream.next() => {
|
||||
match log {
|
||||
Some(Ok(log)) => {
|
||||
@@ -466,21 +467,22 @@ async fn handle_docker_job(
|
||||
rm_container(&client, &container_id).await;
|
||||
|
||||
return Err(e);
|
||||
} else {
|
||||
let _ = tokio::time::timeout(tokio::time::Duration::from_secs(5), logs).await;
|
||||
rm_container(&client, &container_id).await;
|
||||
|
||||
let result = result.unwrap();
|
||||
|
||||
if result.is_some_and(|x| x > 0) {
|
||||
return Err(Error::ExecutionErr(format!(
|
||||
"Docker job completed with unsuccessful exit status: {}",
|
||||
result.unwrap()
|
||||
)));
|
||||
}
|
||||
return Ok(to_raw_value(&json!(format!(
|
||||
"Docker job completed with success exit status"
|
||||
))));
|
||||
}
|
||||
|
||||
rm_container(&client, &container_id).await;
|
||||
|
||||
let result = result.unwrap();
|
||||
|
||||
if result.is_some_and(|x| x > 0) {
|
||||
return Err(Error::ExecutionErr(format!(
|
||||
"Docker job completed with unsuccessful exit status: {}",
|
||||
result.unwrap()
|
||||
)));
|
||||
}
|
||||
return Ok(to_raw_value(&json!(format!(
|
||||
"Docker job completed with success exit status"
|
||||
))));
|
||||
}
|
||||
|
||||
#[cfg(feature = "dind")]
|
||||
|
||||
Reference in New Issue
Block a user