Start ephemera only on monitoring
This commit is contained in:
+21
-20
@@ -121,29 +121,30 @@ async fn start_nym_api_tasks(
|
||||
.await?;
|
||||
}
|
||||
|
||||
let ephemera_config = match EphemeraConfiguration::try_load(config.get_ephemera_config_path()) {
|
||||
Ok(c) => c,
|
||||
Err(_) => {
|
||||
config
|
||||
.get_ephemera_args()
|
||||
.cmd
|
||||
.clone()
|
||||
.execute(Some(&config.get_id()));
|
||||
EphemeraConfiguration::try_load(config.get_ephemera_config_path())
|
||||
.expect("Config file should be created now")
|
||||
}
|
||||
};
|
||||
let ephemera_reward_manager = ephemera::application::NymApi::run(
|
||||
config.get_ephemera_args().clone(),
|
||||
ephemera_config,
|
||||
nyxd_client.clone(),
|
||||
&shutdown,
|
||||
)
|
||||
.await?;
|
||||
|
||||
// and then only start the uptime updater (and the monitor itself, duh)
|
||||
// if the monitoring if it's enabled
|
||||
if config.network_monitor.enabled {
|
||||
let ephemera_config =
|
||||
match EphemeraConfiguration::try_load(config.get_ephemera_config_path()) {
|
||||
Ok(c) => c,
|
||||
Err(_) => {
|
||||
config
|
||||
.get_ephemera_args()
|
||||
.cmd
|
||||
.clone()
|
||||
.execute(Some(&config.get_id()));
|
||||
EphemeraConfiguration::try_load(config.get_ephemera_config_path())
|
||||
.expect("Config file should be created now")
|
||||
}
|
||||
};
|
||||
let ephemera_reward_manager = ephemera::application::NymApi::run(
|
||||
config.get_ephemera_args().clone(),
|
||||
ephemera_config,
|
||||
nyxd_client.clone(),
|
||||
&shutdown,
|
||||
)
|
||||
.await?;
|
||||
|
||||
// if network monitor is enabled, the storage MUST BE available
|
||||
let storage = maybe_storage.unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user