Skip to content

Commit

Permalink
flow: add path to flow script as well
Browse files Browse the repository at this point in the history
  • Loading branch information
uael committed Dec 18, 2024
1 parent ee28955 commit e505b6f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion backend/windmill-common/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ pub enum JobPayload {
apply_preprocessor: bool,
},
FlowScript {
id: FlowNodeId, // flow_node(id).
id: FlowNodeId, // flow_node(id).
path: Option<String>, // flow step path.
language: ScriptLang,
custom_concurrency_key: Option<String>,
concurrent_limit: Option<i32>,
Expand Down
5 changes: 3 additions & 2 deletions backend/windmill-queue/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,8 @@ pub async fn push<'c, 'd>(
)
}
JobPayload::FlowScript {
id, // flow_node(id).
id, // flow_node(id).
path, // flow step path.
language,
custom_concurrency_key,
concurrent_limit,
Expand All @@ -2854,7 +2855,7 @@ pub async fn push<'c, 'd>(
dedicated_worker,
} => (
Some(id.0),
None,
path,
None,
JobKind::FlowScript,
None,
Expand Down
11 changes: 11 additions & 0 deletions backend/windmill-worker/src/worker_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3089,9 +3089,19 @@ async fn compute_next_flow_transform(
concurrency_time_window_s,
..
} => {
let path = if status
.preprocessor_module
.as_ref()
.is_some_and(|x| x.id() == module.id)
{
format!("{}/preprocessor", flow_job.script_path())
} else {
format!("{}/step-{}", flow_job.script_path(), status.step)
};
let payload = JobPayloadWithTag {
payload: JobPayload::FlowScript {
id,
path: Some(path),
language,
custom_concurrency_key: custom_concurrency_key.clone(),
concurrent_limit,
Expand Down Expand Up @@ -3693,6 +3703,7 @@ async fn payload_from_simple_module(
} => JobPayloadWithTag {
payload: JobPayload::FlowScript {
id,
path: inner_path,
language,
custom_concurrency_key,
concurrent_limit,
Expand Down

0 comments on commit e505b6f

Please sign in to comment.