mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-10-20 18:56:21 +00:00
invert logic to make name make sense and fix comment typo
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -96,16 +96,16 @@ impl Chain {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Can we add a node? If not, it's because the chain is at its quota.
|
/// Is the chain the node belongs to overquota?
|
||||||
pub fn is_overquota(&self) -> bool {
|
pub fn is_overquota(&self) -> bool {
|
||||||
// Dynamically determine the max nodes based on the most common
|
// Dynamically determine the max nodes based on the most common
|
||||||
// label so far, in case it changes to something with a different limit.
|
// label so far, in case it changes to something with a different limit.
|
||||||
self.nodes.len() < max_nodes(self.labels.best())
|
self.nodes.len() >= max_nodes(self.labels.best())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Assign a node to this chain.
|
/// Assign a node to this chain.
|
||||||
pub fn add_node(&mut self, node: Node) -> AddNodeResult {
|
pub fn add_node(&mut self, node: Node) -> AddNodeResult {
|
||||||
if !self.is_overquota() {
|
if self.is_overquota() {
|
||||||
return AddNodeResult::Overquota;
|
return AddNodeResult::Overquota;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -637,7 +637,7 @@ async fn slow_feeds_are_disconnected() {
|
|||||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
tokio::time::sleep(Duration::from_secs(5)).await;
|
||||||
|
|
||||||
// Drain anything out and expect to hit a "closed" error, rather than get stuck
|
// Drain anything out and expect to hit a "closed" error, rather than get stuck
|
||||||
// waiting to receive mroe data (or see some other error).
|
// waiting to receive more data (or see some other error).
|
||||||
loop {
|
loop {
|
||||||
let mut v = Vec::new();
|
let mut v = Vec::new();
|
||||||
let data =
|
let data =
|
||||||
|
|||||||
Reference in new issue
Block a user