mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 16:02:14 +00:00
fix: fix agent_workers completed job back-compatibility deserialization
This commit is contained in:
@@ -147,7 +147,7 @@ pub struct JobCompleted {
|
||||
pub token: String,
|
||||
pub canceled_by: Option<CanceledBy>,
|
||||
pub duration: Option<i64>,
|
||||
pub has_stream: bool,
|
||||
pub has_stream: Option<bool>,
|
||||
}
|
||||
|
||||
pub async fn cancel_single_job<'c>(
|
||||
|
||||
@@ -186,14 +186,14 @@ pub async fn handle_dedicated_process(
|
||||
let result = Arc::new(result);
|
||||
append_logs(&job.id, &job.workspace_id, logs.clone(), &db.into()).await;
|
||||
if line.starts_with("wm_res[success]:") {
|
||||
job_completed_tx.send_job(JobCompleted { job , result, result_columns: None, mem_peak: 0, canceled_by: None, success: true, cached_res_path: None, token: token.to_string(), duration: None, preprocessed_args: None, has_stream: false }, true).await.unwrap()
|
||||
job_completed_tx.send_job(JobCompleted { job , result, result_columns: None, mem_peak: 0, canceled_by: None, success: true, cached_res_path: None, token: token.to_string(), duration: None, preprocessed_args: None, has_stream: Some(false) }, true).await.unwrap()
|
||||
} else {
|
||||
job_completed_tx.send_job(JobCompleted { job , result, result_columns: None, mem_peak: 0, canceled_by: None, success: false, cached_res_path: None, token: token.to_string(), duration: None, preprocessed_args: None, has_stream: false }, true).await.unwrap()
|
||||
job_completed_tx.send_job(JobCompleted { job , result, result_columns: None, mem_peak: 0, canceled_by: None, success: false, cached_res_path: None, token: token.to_string(), duration: None, preprocessed_args: None, has_stream: Some(false) }, true).await.unwrap()
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
tracing::error!("Could not deserialize job result `{line}`: {e:?}");
|
||||
job_completed_tx.send_job(JobCompleted { job , result: Arc::new(to_raw_value(&serde_json::json!({"error": format!("Could not deserialize job result `{line}`: {e:?}")}))), result_columns: None, mem_peak: 0, canceled_by: None, success: false, cached_res_path: None, token: token.to_string(), duration: None, preprocessed_args: None, has_stream: false }, true).await.unwrap();
|
||||
job_completed_tx.send_job(JobCompleted { job , result: Arc::new(to_raw_value(&serde_json::json!({"error": format!("Could not deserialize job result `{line}`: {e:?}")}))), result_columns: None, mem_peak: 0, canceled_by: None, success: false, cached_res_path: None, token: token.to_string(), duration: None, preprocessed_args: None, has_stream: Some(false) }, true).await.unwrap();
|
||||
},
|
||||
};
|
||||
logs = init_log.clone();
|
||||
|
||||
@@ -429,7 +429,7 @@ pub async fn process_result(
|
||||
cached_res_path,
|
||||
token: token.to_string(),
|
||||
duration,
|
||||
has_stream,
|
||||
has_stream: Some(has_stream),
|
||||
},
|
||||
)
|
||||
.with_context(windmill_common::otel_oss::otel_ctx())
|
||||
@@ -492,7 +492,7 @@ pub async fn process_result(
|
||||
cached_res_path,
|
||||
token: token.to_string(),
|
||||
duration,
|
||||
has_stream,
|
||||
has_stream: Some(has_stream),
|
||||
},
|
||||
)
|
||||
.with_context(windmill_common::otel_oss::otel_ctx())
|
||||
@@ -632,7 +632,7 @@ pub async fn process_completed_job(
|
||||
canceled_by,
|
||||
false,
|
||||
duration,
|
||||
has_stream,
|
||||
has_stream.unwrap_or(false),
|
||||
)
|
||||
.await?;
|
||||
drop(job);
|
||||
|
||||
@@ -765,7 +765,7 @@ pub async fn handle_all_job_kind_error(
|
||||
cached_res_path: None,
|
||||
token: authed_client.token.clone(),
|
||||
duration: None,
|
||||
has_stream: false,
|
||||
has_stream: Some(false),
|
||||
},
|
||||
false,
|
||||
)
|
||||
@@ -1688,7 +1688,7 @@ pub async fn run_worker(
|
||||
token: "".to_string(),
|
||||
canceled_by: None,
|
||||
duration: None,
|
||||
has_stream: false,
|
||||
has_stream: Some(false),
|
||||
},
|
||||
true,
|
||||
)
|
||||
@@ -2412,7 +2412,7 @@ pub async fn handle_queued_job(
|
||||
cached_res_path: None,
|
||||
token: client.token.clone(),
|
||||
duration: None,
|
||||
has_stream: false,
|
||||
has_stream: Some(false),
|
||||
},
|
||||
true,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user