Skip to content

Commit

Permalink
fix online-node selector
Browse files Browse the repository at this point in the history
  • Loading branch information
haxjump committed Oct 9, 2024
1 parent 496ce21 commit 2e4bd0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/ddev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use chaindev::{
};
use ruc::*;
use serde::{Deserialize, Serialize};
use std::{env, fs, str::FromStr};
use std::{collections::HashSet, env, fs, str::FromStr};

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct EnvCfg {
Expand Down Expand Up @@ -333,7 +333,10 @@ fi "#
let online_nodes = e
.nodes_should_be_online
.iter()
.copied()
.map(|(k, _)| k)
.filter(|k| *k != n.id)
.collect::<HashSet<_>>() // for random purpose
.into_iter()
.take(5)
.collect::<Vec<_>>();

Expand Down
7 changes: 5 additions & 2 deletions src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use chaindev::{
};
use ruc::*;
use serde::{Deserialize, Serialize};
use std::fs;
use std::{collections::HashSet, fs};

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct EnvCfg {
Expand Down Expand Up @@ -221,7 +221,10 @@ fi "#
let online_nodes = e
.nodes_should_be_online
.iter()
.copied()
.map(|(k, _)| k)
.filter(|k| *k != n.id)
.collect::<HashSet<_>>() // for random purpose
.into_iter()
.take(5)
.collect::<Vec<_>>();

Expand Down

0 comments on commit 2e4bd0b

Please sign in to comment.