Skip to content

Commit

Permalink
Update metrics when exiting the Connection run loop
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Dec 30, 2021
1 parent 87dc78a commit 5ebd22a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zebra-network/src/peer/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,13 @@ where
}
}

let error = self.error_slot.try_get_error();
assert!(
self.error_slot.try_get_error().is_some(),
error.is_some(),
"closing connections must call fail_with() or shutdown() to set the error slot"
);

self.update_state_metrics(error.expect("checked is_some").to_string());
}

/// Fail this connection.
Expand Down

0 comments on commit 5ebd22a

Please sign in to comment.