Skip to content

Commit

Permalink
refactor: use addr instead of bind to configure daemon listen add…
Browse files Browse the repository at this point in the history
…ress
  • Loading branch information
Michael-J-Ward committed Apr 17, 2024
1 parent 01707fc commit a9bfafd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions binaries/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ enum Command {
Daemon {
#[clap(long)]
machine_id: Option<String>,
/// The IP address and port this daemon will bind to.
#[clap(long, default_value_t = SocketAddr::new(
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0)
)]
bind: SocketAddr,
addr: SocketAddr,
#[clap(long)]
coordinator_addr: Option<SocketAddr>,

Expand Down Expand Up @@ -292,7 +293,7 @@ fn run() -> eyre::Result<()> {
}
Command::Daemon {
coordinator_addr,
bind,
addr,
machine_id,
run_dataflow,
} => {
Expand All @@ -314,12 +315,12 @@ fn run() -> eyre::Result<()> {
Daemon::run_dataflow(&dataflow_path).await
}
None => {
let addr = coordinator_addr.unwrap_or_else(|| {
let coordination_addr = coordinator_addr.unwrap_or_else(|| {
tracing::info!("Starting in local mode");
let localhost = Ipv4Addr::new(127, 0, 0, 1);
(localhost, DORA_COORDINATOR_PORT_DEFAULT).into()
});
Daemon::run(addr, machine_id.unwrap_or_default(), bind).await
Daemon::run(coordination_addr, machine_id.unwrap_or_default(), addr).await
}
}
})
Expand Down

0 comments on commit a9bfafd

Please sign in to comment.