Skip to content

Commit

Permalink
chore: address review
Browse files Browse the repository at this point in the history
  • Loading branch information
msgmaxim committed Oct 16, 2023
1 parent de2f4fb commit 4a431e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions api/bin/chainflip-ingress-egress-tracker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ async fn start(
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.try_init()
.expect("setting default subscriber failed");
let server = ServerBuilder::default().build("0.0.0.0:13337".parse::<SocketAddr>()?).await?;
let mut module = RpcModule::new(());

let btc_tracker = witnessing::btc::start(scope).await;
Expand All @@ -38,7 +37,7 @@ async fn start(
}
})?;

// Broadcast channel will drop old messages when the buffer if full to
// Broadcast channel will drop old messages when the buffer is full to
// avoid "memory leaks" due to slow receivers.
const EVENT_BUFFER_SIZE: usize = 1024;
let (witness_sender, _) =
Expand Down Expand Up @@ -66,10 +65,10 @@ async fn start(
},
)?;

let addr = server.local_addr()?;
log::info!("Listening on http://{}", addr);

scope.spawn(async {
let server = ServerBuilder::default().build("0.0.0.0:13337".parse::<SocketAddr>()?).await?;
let addr = server.local_addr()?;
log::info!("Listening on http://{}", addr);
server.start(module)?.stopped().await;
// If the server stops for some reason, we return
// error to terminate other tasks and the process.
Expand Down
4 changes: 2 additions & 2 deletions api/bin/chainflip-ingress-egress-tracker/src/witnessing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ pub(super) async fn start(
async move {
// Send may fail if there aren't any subscribers,
// but it is safe to ignore the error.
if let Ok(n) = witness_sender.send(call) {
tracing::info!("Broadcasting witnesser call to {} subscribers", n);
if let Ok(n) = witness_sender.send(call.clone()) {
tracing::info!("Broadcasting witnesser call {:?} to {} subscribers", call, n);
}
}
}
Expand Down

0 comments on commit 4a431e9

Please sign in to comment.