From 4aa269f71fc571a336ac651c00b69c4ec5796af2 Mon Sep 17 00:00:00 2001 From: yacine Bouraroui Date: Wed, 2 Oct 2024 18:44:04 +0200 Subject: [PATCH] reduce boilerplate --- backend/windmill-queue/src/jobs.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index c2d054b34f..a67217a22c 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -2298,19 +2298,12 @@ pub async fn get_result_by_id( node_id: &str, json_path: Option<&str>, ) -> error::Result> { - #[derive(sqlx::FromRow, Debug, Serialize, Clone)] + #[derive(sqlx::FromRow, Debug)] struct RunningFlowJobResult { pub id: Uuid, pub flow_status: Option>>, } - - impl FlowStatusGetter for RunningFlowJobResult { - fn get_raw_flow_status( - &self, - ) -> Option<&sqlx::types::Json>> { - self.flow_status.as_ref() - } - } + impl_flow_status_getter!(RunningFlowJobResult); match get_result_by_id_from_running_flow(&db, w_id, &flow_id, node_id, json_path).await { Ok(res) => Ok(res),