Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Sep 10, 2024
1 parent 6c752fd commit 4f61116
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion paladin-core/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rand::{distributions::Alphanumeric, Rng};
pub fn get_random_routing_key() -> String {
rand::thread_rng()
.sample_iter(&Alphanumeric)
.take(10)
.take(5)
.map(char::from)
.collect()
}
1 change: 1 addition & 0 deletions paladin-core/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub struct Config {
pub amqp_uri: Option<String>,

/// Provides the routing key for workers to listen on, if the AMQP runtime
/// is used in configuration.
#[arg(long, help_heading = HELP_HEADING)]
pub task_bus_routing_key: Option<String>,
}
Expand Down
5 changes: 2 additions & 3 deletions paladin-core/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub struct Runtime {
_marker: Marker,
}

const IPC_ROUTING_KEY: &str = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const IPC_ROUTING_KEY: &str = "ipc-routing-key";
pub const DEFAULT_ROUTING_KEY: &str = "default";

impl Runtime {
Expand Down Expand Up @@ -712,15 +712,14 @@ impl WorkerRuntime {
}

let routing_key = payload.clone().routing_key;
let routing_key_clone = routing_key.clone(); // Clone here
let routing_key_clone = routing_key.clone();

let span = debug_span!("remote_execute", routing_key = %routing_key_clone);
let execution_task = payload.remote_execute().instrument(span);

// Create a future that will wait for an IPC termination signal.
let ipc_sig_term = {
let mut ipc_sig_term_rx = ipc_sig_term_rx.clone();
let routing_key_clone = routing_key_clone.clone(); // Clone here
async move {
loop {
ipc_sig_term_rx.changed().await.expect("IPC channel closed");
Expand Down

0 comments on commit 4f61116

Please sign in to comment.