Skip to content

Commit

Permalink
ol serve: deprecating the --run-checks or -c option. We now assume th…
Browse files Browse the repository at this point in the history
…e user wants to run checks while running the web-monitor
  • Loading branch information
0o-de-lally committed Jun 19, 2022
1 parent 21c6942 commit c61e4cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions ol/cli/src/commands/serve_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use abscissa_core::{Command, Options, Runnable};
#[derive(Command, Debug, Options)]
pub struct ServeCmd {
/// Start healthcheck runner
#[options(short = "c", help = "start health check runner")]
#[options(short = "c", help = "deprecation notice: -c is no longer valid. Previously it was necessary if healthchecks were to be updated while server is running, but now we assume that is the intention of the user.")]
run_checks: bool,
/// Update the web files
#[options(no_short, help = "update web files for server")]
Expand All @@ -32,8 +32,8 @@ impl Runnable for ServeCmd {
},
};
let mut node = Node::new(client, &cfg, is_swarm);
server::init(&mut node, self.run_checks);
server::start_server(node, self.run_checks);
server::init(&mut node, true);
server::start_server(node, true);
}
}
}
12 changes: 6 additions & 6 deletions ol/cli/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ use crate::{cache::Vitals, check::runner, node::node::Node};

#[tokio::main]
/// starts the web server
pub async fn start_server(mut node: Node, run_checks: bool) {
pub async fn start_server(mut node: Node, _run_checks: bool) {
let cfg = node.app_conf.clone();

if run_checks {
// if run_checks {
thread::spawn(move || {
runner::run_checks(&mut node, false, true, false, false);
});
}
// }

//GET check/ (json api for check data)
let node_home = cfg.clone().workspace.node_home.clone();
Expand Down Expand Up @@ -82,15 +82,15 @@ pub async fn start_server(mut node: Node, run_checks: bool) {
}

/// Prepare to start server
pub fn init(node: &mut Node, run_checks: bool) {
if run_checks {
pub fn init(node: &mut Node, _run_checks: bool) {
// if run_checks {
/*
Initialize cache to avoid:
- read a cache file not created yet
- load old cache with invalid structs
*/
node.check_once(false);
}
// }
}

fn sse_vitals(data: Vitals) -> Result<Event, Error> {
Expand Down

0 comments on commit c61e4cb

Please sign in to comment.