Skip to content

Commit 3d58031

Browse files
committed
tuning online status mgmt
1 parent 49782ce commit 3d58031

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "chaindev"
3-
version = "0.52.6"
3+
version = "0.52.7"
44
edition = "2021"
55
authors = ["hui.fan@mail.ru"]
66
description = "Powerful development and testing utils for blockchain developers."

src/beacon_based/ddev/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ where
7070
.c(d!())
7171
.and_then(|mut env| {
7272
env.push_nodes(
73-
alt!(*fullnode, NodeKind::FullNode, NodeKind::ArchiveNode,),
73+
alt!(*fullnode, NodeKind::FullNode, NodeKind::ArchiveNode),
7474
Some(custom_data.clone()),
7575
host.as_ref(),
7676
*num,
@@ -325,7 +325,7 @@ where
325325
/// Non-fuhrer node collection
326326
pub nodes: BTreeMap<NodeID, N>,
327327

328-
/// An in-memory cache for recording node status,
328+
/// An cache for recording node status,
329329
pub nodes_should_be_online: MapxOrd<NodeID, ()>,
330330

331331
/// Data data may be useful when cfg/running nodes,
@@ -955,8 +955,9 @@ where
955955
let mut online_ids = vec![];
956956
let mut errlist = vec![];
957957

958-
// Use chunks to avoid resource overload
959-
for (idx, nodes) in nodes.chunks(12).enumerate() {
958+
// Use chunks to avoid resource overload,
959+
// set a smaller chunk size here!
960+
for (idx, nodes) in nodes.chunks(6).enumerate() {
960961
thread::scope(|s| {
961962
nodes
962963
.iter()
@@ -983,9 +984,10 @@ where
983984
}
984985
});
985986
});
986-
}
987987

988-
self.update_online_status(&online_ids, &[]);
988+
// Update with each chunk
989+
self.update_online_status(&online_ids, &[]);
990+
}
989991

990992
if !ignore_failed {
991993
check_errlist!(@errlist)

0 commit comments

Comments
 (0)