Skip to content
Snippets Groups Projects
Verified Commit 84395a0a authored by Eduardo Trujillo's avatar Eduardo Trujillo
Browse files

fix(cli): Move thread monitor initialization to cli module

parent 191f98f2
No related branches found
No related tags found
1 merge request!3v2.0.0
......@@ -33,6 +33,8 @@ pub enum Error {
type Result<T, E = Error> = std::result::Result<T, E>;
pub async fn serve(config: Arc<Config>) -> Result<()> {
MONITOR.init().context(MonitorError)?;
console_subscriber::init();
// Set up a channel for receiving thread notifications.
......
......@@ -12,19 +12,14 @@ use cli::{
};
use collective::{
cli::ConfigurableAppOpts,
thread::monitor::{self, ThreadMonitor},
thread::monitor::{self},
};
use espresso::{bundle::packager, config, stats};
use lazy_static::lazy_static;
use snafu::{ResultExt, Snafu};
use std::{net::SocketAddr, sync::Arc};
pub mod cli;
lazy_static! {
static ref MONITOR: ThreadMonitor = ThreadMonitor::new();
}
#[derive(Snafu, Debug)]
pub enum Error {
OpenConfig {
......@@ -69,8 +64,6 @@ async fn main() -> Result<()> {
}
async fn inner_main() -> Result<()> {
MONITOR.init().context(MonitorError)?;
let (opts, config) = Opts::try_init_with_config().context(CliError)?;
let config = Arc::new(config);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment