File tree 3 files changed +14
-10
lines changed
3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -1903,7 +1903,7 @@ mod test {
1903
1903
address: compute_node. to_string( ) ,
1904
1904
} ] ,
1905
1905
storage_nodes : vec ! [ ] ,
1906
- user_nodes : vec ! [ ] ,
1906
+ user_nodes : Some ( vec ! [ ] ) ,
1907
1907
compute_raft : 0 ,
1908
1908
compute_raft_tick_timeout : 10 ,
1909
1909
compute_mining_event_timeout : 500 ,
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ pub struct ComputeNodeConfig {
114
114
/// All storage nodes addresses: only use first
115
115
pub storage_nodes : Vec < NodeSpec > ,
116
116
/// All user nodes addresses
117
- pub user_nodes : Vec < NodeSpec > ,
117
+ pub user_nodes : Option < Vec < NodeSpec > > ,
118
118
/// Whether compute node will use raft or act independently (0)
119
119
pub compute_raft : usize ,
120
120
/// API port
Original file line number Diff line number Diff line change @@ -1136,6 +1136,17 @@ async fn init_compute(
1136
1136
) -> ArcComputeNode {
1137
1137
let node_info = & info. node_infos [ name] ;
1138
1138
let compute_raft = usize:: from ( config. compute_raft ) ;
1139
+ let mut user_nodes = None ;
1140
+
1141
+ if info. user_nodes . len ( ) > 0 {
1142
+ user_nodes = Some (
1143
+ info. user_nodes . clone ( ) . into_iter ( )
1144
+ . map ( |v| NodeSpec {
1145
+ address : v. to_string ( ) ,
1146
+ } )
1147
+ . collect :: < Vec < NodeSpec > > ( ) ,
1148
+ ) ;
1149
+ }
1139
1150
1140
1151
let config = ComputeNodeConfig {
1141
1152
compute_db_mode : node_info. db_mode ,
@@ -1159,14 +1170,7 @@ async fn init_compute(
1159
1170
address : v. to_string ( ) ,
1160
1171
} )
1161
1172
. collect :: < Vec < NodeSpec > > ( ) ,
1162
- user_nodes : info
1163
- . user_nodes
1164
- . clone ( )
1165
- . into_iter ( )
1166
- . map ( |v| NodeSpec {
1167
- address : v. to_string ( ) ,
1168
- } )
1169
- . collect :: < Vec < NodeSpec > > ( ) ,
1173
+ user_nodes,
1170
1174
compute_raft,
1171
1175
compute_raft_tick_timeout : 200 / config. test_duration_divider ,
1172
1176
compute_mining_event_timeout : 500 / config. test_duration_divider ,
You can’t perform that action at this time.
0 commit comments