Commit 1a28309 1 parent 07a3fb6 commit 1a28309 Copy full SHA for 1a28309
File tree 3 files changed +2
-14
lines changed
3 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -226,16 +226,12 @@ impl Tsl {
226
226
pub struct Configuration {
227
227
/// The state of the configuration.
228
228
pub settings : RwLock < TorrustIndex > ,
229
- /// The path to the configuration file. This is `None` if the configuration
230
- /// was loaded from the environment.
231
- pub config_path : Option < String > ,
232
229
}
233
230
234
231
impl Default for Configuration {
235
232
fn default ( ) -> Configuration {
236
233
Configuration {
237
234
settings : RwLock :: new ( TorrustIndex :: default ( ) ) ,
238
- config_path : None ,
239
235
}
240
236
}
241
237
}
@@ -268,7 +264,6 @@ impl Configuration {
268
264
269
265
Ok ( Configuration {
270
266
settings : RwLock :: new ( index_config) ,
271
- config_path : None ,
272
267
} )
273
268
}
274
269
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ use torrust_index::{app, config};
10
10
/// It launches the app and provides a way to stop it.
11
11
pub struct AppStarter {
12
12
configuration : config:: TorrustIndex ,
13
- config_path : Option < String > ,
14
13
/// The application binary state (started or not):
15
14
/// - `None`: if the app is not started,
16
15
/// - `RunningState`: if the app was started.
@@ -19,10 +18,9 @@ pub struct AppStarter {
19
18
20
19
impl AppStarter {
21
20
#[ must_use]
22
- pub fn with_custom_configuration ( configuration : config:: TorrustIndex , config_path : Option < String > ) -> Self {
21
+ pub fn with_custom_configuration ( configuration : config:: TorrustIndex ) -> Self {
23
22
Self {
24
23
configuration,
25
- config_path,
26
24
running_state : None ,
27
25
}
28
26
}
@@ -35,7 +33,6 @@ impl AppStarter {
35
33
pub async fn start ( & mut self , api_version : Version ) {
36
34
let configuration = Configuration {
37
35
settings : RwLock :: new ( self . configuration . clone ( ) ) ,
38
- config_path : self . config_path . clone ( ) ,
39
36
} ;
40
37
41
38
// Open a channel to communicate back with this function
Original file line number Diff line number Diff line change @@ -33,12 +33,8 @@ impl TestEnv {
33
33
let temp_dir = TempDir :: new ( ) . expect ( "failed to create a temporary directory" ) ;
34
34
35
35
let configuration = ephemeral ( & temp_dir) ;
36
- // Even if we load the configuration from the environment variable, we
37
- // still need to provide a path to save the configuration when the
38
- // configuration is updated via the `POST /settings` endpoints.
39
- let config_path = format ! ( "{}/config.toml" , temp_dir. path( ) . to_string_lossy( ) ) ;
40
36
41
- let app_starter = AppStarter :: with_custom_configuration ( configuration, Some ( config_path ) ) ;
37
+ let app_starter = AppStarter :: with_custom_configuration ( configuration) ;
42
38
43
39
Self { app_starter, temp_dir }
44
40
}
You can’t perform that action at this time.
0 commit comments