ApplicationConfig: abolish accessor
This commit is contained in:
parent
85cf744e9e
commit
94f4728a1c
|
@ -28,14 +28,7 @@ pub struct ApplicationConfig {
|
||||||
/// recreated, or for some other reason).
|
/// recreated, or for some other reason).
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[builder(default)]
|
#[builder(default)]
|
||||||
watch_configuration: bool,
|
pub(crate) watch_configuration: bool,
|
||||||
}
|
|
||||||
|
|
||||||
impl ApplicationConfig {
|
|
||||||
/// Return true if we're configured to watch for configuration changes.
|
|
||||||
pub fn watch_configuration(&self) -> bool {
|
|
||||||
self.watch_configuration
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configuration for one or more proxy listeners.
|
/// Configuration for one or more proxy listeners.
|
||||||
|
|
|
@ -159,7 +159,7 @@ pub async fn run<R: Runtime>(
|
||||||
.config(client_config)
|
.config(client_config)
|
||||||
.bootstrap_behavior(OnDemand)
|
.bootstrap_behavior(OnDemand)
|
||||||
.create_unbootstrapped()?;
|
.create_unbootstrapped()?;
|
||||||
if arti_config.application().watch_configuration() {
|
if arti_config.application().watch_configuration {
|
||||||
watch_cfg::watch_for_config_changes(config_sources, arti_config, client.clone())?;
|
watch_cfg::watch_for_config_changes(config_sources, arti_config, client.clone())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ fn reconfigure<R: Runtime>(
|
||||||
let client_config = config.tor_client_config()?;
|
let client_config = config.tor_client_config()?;
|
||||||
client.reconfigure(&client_config, Reconfigure::WarnOnFailures)?;
|
client.reconfigure(&client_config, Reconfigure::WarnOnFailures)?;
|
||||||
|
|
||||||
if !config.application().watch_configuration() {
|
if !config.application().watch_configuration {
|
||||||
// Stop watching for configuration changes.
|
// Stop watching for configuration changes.
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue