forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracker_checker.rs
More file actions
25 lines (22 loc) · 761 Bytes
/
tracker_checker.rs
File metadata and controls
25 lines (22 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use std::io;
use std::process::Command;
/// Runs the Tracker Checker.
///
/// # Errors
///
/// Will return an error if the Tracker Checker fails.
pub fn run(config_content: &str) -> io::Result<()> {
tracing::info!(
"Running Tracker Checker: TORRUST_CHECKER_CONFIG=[config] cargo run -p torrust-tracker-client --bin tracker_checker"
);
tracing::info!("Tracker Checker config:\n{config_content}");
let status = Command::new("cargo")
.env("TORRUST_CHECKER_CONFIG", config_content)
.args(["run", "-p", "torrust-tracker-client", "--bin", "tracker_checker"])
.status()?;
if status.success() {
Ok(())
} else {
Err(io::Error::new(io::ErrorKind::Other, "Failed to run Tracker Checker"))
}
}