Skip to content

Commit

Permalink
broker: discard new connection if already connected
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-maron committed Mar 18, 2024
1 parent c585b07 commit 8f9cc2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cdn-broker/src/handlers/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ impl<
// Create new batch sender
let (sender, receiver) = connection;

// If we are already connected, ignore the new connection
if self.connections.all_brokers().contains(&broker_identifier) {
return;
}

// Add to our brokers
self.connections
.add_broker(broker_identifier.clone(), sender);
Expand Down

0 comments on commit 8f9cc2d

Please sign in to comment.