Remove debug statements
This commit is contained in:
parent
dbf1c648ae
commit
f6c30a327a
|
@ -65,7 +65,6 @@ impl SbotStatus {
|
||||||
/// Retrieve statistics for the go-sbot systemd process by querying `systemctl`.
|
/// Retrieve statistics for the go-sbot systemd process by querying `systemctl`.
|
||||||
pub fn read() -> Result<Self, PeachError> {
|
pub fn read() -> Result<Self, PeachError> {
|
||||||
let system_manager = config_manager::get_config_value("SYSTEM_MANAGER")?;
|
let system_manager = config_manager::get_config_value("SYSTEM_MANAGER")?;
|
||||||
info!("SYSTEM_MANAGER: {:?}", system_manager);
|
|
||||||
match system_manager.as_str() {
|
match system_manager.as_str() {
|
||||||
"systemd" => {
|
"systemd" => {
|
||||||
SbotStatus::read_from_systemctl()
|
SbotStatus::read_from_systemctl()
|
||||||
|
@ -81,17 +80,14 @@ impl SbotStatus {
|
||||||
|
|
||||||
pub fn read_from_supervisorctl() -> Result<Self, PeachError> {
|
pub fn read_from_supervisorctl() -> Result<Self, PeachError> {
|
||||||
let mut status = SbotStatus::default();
|
let mut status = SbotStatus::default();
|
||||||
// TODO: implement this
|
|
||||||
let info_output = Command::new("supervisorctl")
|
let info_output = Command::new("supervisorctl")
|
||||||
.arg("status")
|
.arg("status")
|
||||||
.arg(config_manager::get_config_value("GO_SBOT_SERVICE")?)
|
.arg(config_manager::get_config_value("GO_SBOT_SERVICE")?)
|
||||||
.output()?;
|
.output()?;
|
||||||
info!("info: {:?}", info_output);
|
|
||||||
|
|
||||||
let service_info = std::str::from_utf8(&info_output.stdout)?;
|
let service_info = std::str::from_utf8(&info_output.stdout)?;
|
||||||
|
|
||||||
for line in service_info.lines() {
|
for line in service_info.lines() {
|
||||||
info!("line: {:?}", line);
|
|
||||||
// example line
|
// example line
|
||||||
// go-sbot RUNNING pid 11, uptime 0:04:23
|
// go-sbot RUNNING pid 11, uptime 0:04:23
|
||||||
if line.contains("RUNNING") {
|
if line.contains("RUNNING") {
|
||||||
|
|
|
@ -29,7 +29,6 @@ use crate::{error::PeachWebError, utils::sbot};
|
||||||
/// This utility function calls the correct system calls based on these parameters.
|
/// This utility function calls the correct system calls based on these parameters.
|
||||||
pub fn system_sbot_cmd(cmd: &str) -> Result<Output, PeachWebError> {
|
pub fn system_sbot_cmd(cmd: &str) -> Result<Output, PeachWebError> {
|
||||||
let system_manager = config_manager::get_config_value("SYSTEM_MANAGER")?;
|
let system_manager = config_manager::get_config_value("SYSTEM_MANAGER")?;
|
||||||
info!("SYSTEM_MANAGER: {:?}", system_manager);
|
|
||||||
match system_manager.as_str() {
|
match system_manager.as_str() {
|
||||||
"systemd" => {
|
"systemd" => {
|
||||||
let output = Command::new("sudo")
|
let output = Command::new("sudo")
|
||||||
|
@ -55,12 +54,10 @@ pub fn system_sbot_cmd(cmd: &str) -> Result<Output, PeachWebError> {
|
||||||
Ok(output)
|
Ok(output)
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
info!("supervisorctl {:?} {:?}", cmd, config_manager::get_config_value("GO_SBOT_SERVICE")?);
|
|
||||||
let output = Command::new("supervisorctl")
|
let output = Command::new("supervisorctl")
|
||||||
.arg(cmd)
|
.arg(cmd)
|
||||||
.arg(config_manager::get_config_value("GO_SBOT_SERVICE")?)
|
.arg(config_manager::get_config_value("GO_SBOT_SERVICE")?)
|
||||||
.output()?;
|
.output()?;
|
||||||
info!("logging: {:?}", output);
|
|
||||||
Ok(output)
|
Ok(output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue