Skip to content

Commit

Permalink
collector: don't try to send events when nothing can receive them (#1507
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dyc3 authored Mar 15, 2024
1 parent 0422f49 commit ef200a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/ott-collector/src/event_bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ impl EventBus {

fn handle_event(&self, event: String) {
info!("Received event: {}", event);
if self.bus_tx.receiver_count() == 0 {
return;
}
match self.bus_tx.send(event) {
Ok(count) => {
info!("Event sent to {count} subscribers");
Expand Down

0 comments on commit ef200a3

Please sign in to comment.