Skip to content

Commit

Permalink
reuse pjs code execution code
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgunozerk committed Jul 30, 2024
1 parent 9afc1d2 commit d9c4028
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions crates/orchestrator/src/network/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,7 @@ impl NetworkNode {
user_types: Option<serde_json::Value>,
) -> Result<PjsResult, anyhow::Error> {
let content = std::fs::read_to_string(file)?;
let code = pjs_build_template(self.ws_uri(), content.as_ref(), args, user_types);
tracing::trace!("Code to execute: {code}");

let value = match pjs_exec(code)? {
ReturnValue::Deserialized(val) => Ok(val),
ReturnValue::CantDeserialize(msg) => Err(msg),
};

Ok(value)
self.pjs(content, args, user_types).await
}

async fn fetch_metrics(&self) -> Result<(), anyhow::Error> {
Expand Down

0 comments on commit d9c4028

Please sign in to comment.