Remove debug statements

This commit is contained in:
notplants 2022-07-28 14:56:27 +02:00
parent dbf1c648ae
commit f6c30a327a
2 changed files with 0 additions and 7 deletions

View File

@ -65,7 +65,6 @@ impl SbotStatus {
/// Retrieve statistics for the go-sbot systemd process by querying `systemctl`.
pub fn read() -> Result<Self, PeachError> {
let system_manager = config_manager::get_config_value("SYSTEM_MANAGER")?;
info!("SYSTEM_MANAGER: {:?}", system_manager);
match system_manager.as_str() {
"systemd" => {
SbotStatus::read_from_systemctl()
@ -81,17 +80,14 @@ impl SbotStatus {
pub fn read_from_supervisorctl() -> Result<Self, PeachError> {
let mut status = SbotStatus::default();
// TODO: implement this
let info_output = Command::new("supervisorctl")
.arg("status")
.arg(config_manager::get_config_value("GO_SBOT_SERVICE")?)
.output()?;
info!("info: {:?}", info_output);
let service_info = std::str::from_utf8(&info_output.stdout)?;
for line in service_info.lines() {
info!("line: {:?}", line);
// example line
// go-sbot RUNNING pid 11, uptime 0:04:23
if line.contains("RUNNING") {

View File

@ -29,7 +29,6 @@ use crate::{error::PeachWebError, utils::sbot};
/// This utility function calls the correct system calls based on these parameters.
pub fn system_sbot_cmd(cmd: &str) -> Result<Output, PeachWebError> {
let system_manager = config_manager::get_config_value("SYSTEM_MANAGER")?;
info!("SYSTEM_MANAGER: {:?}", system_manager);
match system_manager.as_str() {
"systemd" => {
let output = Command::new("sudo")
@ -55,12 +54,10 @@ pub fn system_sbot_cmd(cmd: &str) -> Result<Output, PeachWebError> {
Ok(output)
}
_ => {
info!("supervisorctl {:?} {:?}", cmd, config_manager::get_config_value("GO_SBOT_SERVICE")?);
let output = Command::new("supervisorctl")
.arg(cmd)
.arg(config_manager::get_config_value("GO_SBOT_SERVICE")?)
.output()?;
info!("logging: {:?}", output);
Ok(output)
}
}