Skip to content

Commit

Permalink
ignore zero-weight hosts in the auto-select mode
Browse files Browse the repository at this point in the history
  • Loading branch information
haxjump committed Dec 6, 2024
1 parent be3f8f2 commit b1c62ba
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chaindev"
version = "0.52.2"
version = "0.52.3"
edition = "2021"
authors = ["hui.fan@mail.ru"]
description = "Powerful development and testing utils for blockchain developers."
Expand Down
1 change: 1 addition & 0 deletions src/beacon_based/ddev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,7 @@ where
.hosts
.as_ref()
.values()
.filter(|h| h.weight > 0) // never allocate on 'zero-weight hosts'
.map(|h| (h.meta.clone(), (h.node_cnt * max_weight) / h.weight))
.collect::<Vec<_>>();
seq.sort_by(|a, b| a.1.cmp(&b.1));
Expand Down
2 changes: 1 addition & 1 deletion src/common/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<'a> From<&'a Host> for Remote<'a> {
}
}

impl<'a> Remote<'a> {
impl Remote<'_> {
// Execute a cmd on a remote host and get its outputs
pub fn exec_cmd(&self, cmd: &str) -> Result<String> {
let cmd = format!("ulimit -n 100000 >/dev/null 2>&1;{}", cmd);
Expand Down
1 change: 1 addition & 0 deletions src/tendermint_based/ddev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,7 @@ where
.hosts
.as_ref()
.values()
.filter(|h| h.weight > 0) // never allocate on 'zero-weight hosts'
.map(|h| (h.meta.clone(), (h.node_cnt * max_weight) / h.weight))
.collect::<Vec<_>>();
seq.sort_by(|a, b| a.1.cmp(&b.1));
Expand Down

0 comments on commit b1c62ba

Please sign in to comment.