Skip to content

Commit

Permalink
fix: ensure connections are always correctly closed
Browse files Browse the repository at this point in the history
  • Loading branch information
msgmaxim committed Oct 11, 2023
1 parent 30701b3 commit b527050
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/bin/chainflip-ingress-egress-tracker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ async fn main() -> anyhow::Result<()> {
// won't be released, and we will eventually reach the limit, so we increase
// as a way to mitigate this issue.
// TODO: ensure that connections are always released
.max_connections(1000)
.build("0.0.0.0:13337".parse::<SocketAddr>()?)
.await?;
let mut module = RpcModule::new(());
Expand Down Expand Up @@ -381,7 +380,10 @@ async fn main() -> anyhow::Result<()> {
tokio::spawn(async move {
while let Ok(event) = witness_receiver.recv().await {
use codec::Encode;
let _ = sink.send(&event.encode());
if let Ok(false) = sink.send(&event.encode()) {
log::debug!("Subscription is closed");
break
}
}
});
Ok(())
Expand Down

0 comments on commit b527050

Please sign in to comment.