mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-12 08:51:11 +00:00
Address David's comments
This commit is contained in:
@@ -37,7 +37,7 @@ pub struct Aggregator(Arc<AggregatorInternal>);
|
||||
struct AggregatorInternal {
|
||||
/// Shards that connect are each assigned a unique connection ID.
|
||||
/// This helps us know who to send messages back to (especially in
|
||||
/// conjunction with the [`LocalId`] that messages will come with).
|
||||
/// conjunction with the `ShardNodeId` that messages will come with).
|
||||
shard_conn_id: AtomicU64,
|
||||
/// Feeds that connect have their own unique connection ID, too.
|
||||
feed_conn_id: AtomicU64,
|
||||
|
||||
@@ -97,7 +97,7 @@ impl Chain {
|
||||
}
|
||||
|
||||
/// Can we add a node? If not, it's because the chain is at its quota.
|
||||
pub fn can_add_node(&self) -> bool {
|
||||
pub fn is_overquota(&self) -> bool {
|
||||
// Dynamically determine the max nodes based on the most common
|
||||
// label so far, in case it changes to something with a different limit.
|
||||
self.nodes.len() < max_nodes(self.labels.best())
|
||||
@@ -105,7 +105,7 @@ impl Chain {
|
||||
|
||||
/// Assign a node to this chain.
|
||||
pub fn add_node(&mut self, node: Node) -> AddNodeResult {
|
||||
if !self.can_add_node() {
|
||||
if !self.is_overquota() {
|
||||
return AddNodeResult::Overquota;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user