File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -123,16 +123,23 @@ where
123
123
throttle,
124
124
} ;
125
125
126
- // Write configs to files
127
- if let Some ( config) = conf. node_config ( ) {
128
- let config_path = dir. join ( format ! ( "{}_config.toml" , conf. kind) ) ;
126
+ conf. write_to_file ( ) ?;
127
+
128
+ Ok ( conf)
129
+ }
130
+
131
+ // Write configs to files
132
+ pub fn write_to_file ( & self ) -> Result < ( ) > {
133
+ let dir = & self . base . dir ;
134
+ if let Some ( config) = self . node_config ( ) {
135
+ let config_path = dir. join ( format ! ( "{}_config.toml" , self . kind) ) ;
129
136
config_to_file ( config, & config_path) ?;
130
137
}
131
138
132
- let rollup_path = dir. join ( format ! ( "{}_rollup_config.toml" , conf . kind) ) ;
133
- config_to_file ( & conf . rollup , & rollup_path) ?;
139
+ let rollup_path = dir. join ( format ! ( "{}_rollup_config.toml" , self . kind) ) ;
140
+ config_to_file ( & self . rollup , & rollup_path) ?;
134
141
135
- Ok ( conf )
142
+ Ok ( ( ) )
136
143
}
137
144
}
138
145
Original file line number Diff line number Diff line change @@ -327,16 +327,8 @@ where
327
327
) ) ;
328
328
copy_directory ( old_dir, & new_dir) ?;
329
329
330
- // Replace the config files with the new ones
331
- let rollup_config_path = new_dir. join ( format ! ( "{}_rollup_config.toml" , config. kind( ) ) ) ;
332
- config_to_file ( & config. rollup , & rollup_config_path) ?;
333
- if let Some ( node_config) = config. node_config ( ) {
334
- let node_config_path = new_dir. join ( format ! ( "{}_config.toml" , config. kind( ) ) ) ;
335
- config_to_file ( & node_config, & node_config_path) ?;
336
- }
330
+ config. write_to_file ( ) ?;
337
331
338
- config. set_dir ( new_dir) ;
339
- // Replace config contents
340
332
* self . spawn_output ( ) = Self :: spawn ( config, extra_args) ?;
341
333
self . wait_for_ready ( None ) . await
342
334
}
You can’t perform that action at this time.
0 commit comments