Skip to content

Commit

Permalink
fix(engine): remove unused routing ports from actions and update asse…
Browse files Browse the repository at this point in the history
…t download logic
  • Loading branch information
miseyu committed Dec 11, 2024
1 parent 908fab6 commit 9330206
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 40 deletions.
2 changes: 0 additions & 2 deletions engine/docs/mdbook/src/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,6 @@ Action for first port forwarding for sub-workflows.
}
```
### Input Ports
* routingPort
### Output Ports
* default
### Category
Expand Down Expand Up @@ -2336,7 +2335,6 @@ Action for last port forwarding for sub-workflows.
### Input Ports
* default
### Output Ports
* routingPort
### Category
* System

Expand Down
4 changes: 2 additions & 2 deletions engine/runtime/runtime/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl ProcessorFactory for InputRouterFactory {
}

fn get_input_ports(&self) -> Vec<Port> {
vec![Port::new(ROUTING_PARAM_KEY)]
vec![]
}

fn get_output_ports(&self) -> Vec<Port> {
Expand Down Expand Up @@ -497,7 +497,7 @@ impl ProcessorFactory for OutputRouterFactory {
}

fn get_output_ports(&self) -> Vec<Port> {
vec![Port::new(ROUTING_PARAM_KEY)]
vec![]
}

fn build(
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
8 changes: 2 additions & 6 deletions engine/schema/actions_zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2086,9 +2086,7 @@
}
},
"builtin": true,
"inputPorts": [
"routingPort"
],
"inputPorts": [],
"outputPorts": [
"default"
],
Expand Down Expand Up @@ -2347,9 +2345,7 @@
"inputPorts": [
"default"
],
"outputPorts": [
"routingPort"
],
"outputPorts": [],
"categories": [
"System"
]
Expand Down
3 changes: 3 additions & 0 deletions engine/worker/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ pub(crate) async fn download_asset(
asset: &Asset,
download_path: &Uri,
) -> crate::errors::Result<()> {
if asset.is_empty() {
return Ok(());
}
let uris = asset
.files
.iter()
Expand Down
6 changes: 6 additions & 0 deletions engine/worker/src/types/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ pub struct Asset {
pub files: Vec<String>,
}

impl Asset {
pub fn is_empty(&self) -> bool {
self.files.is_empty()
}
}

#[derive(Serialize, Deserialize, Debug, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct AssetFile {
Expand Down

0 comments on commit 9330206

Please sign in to comment.