fix: remove duplicate logger init causing 'cannot set logger' error
Logger is already initialized in main.rs, cli.rs was trying to initialize it again when CLI commands were run.
This commit is contained in:
parent
d73d782659
commit
5f71614451
2 changed files with 18 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"base_url": "http://localhost:8080",
|
||||
"default_org": {
|
||||
"id": "350170397284499470",
|
||||
"id": "350192628202995726",
|
||||
"name": "default",
|
||||
"domain": "default.localhost"
|
||||
},
|
||||
|
|
@ -13,8 +13,8 @@
|
|||
"first_name": "Admin",
|
||||
"last_name": "User"
|
||||
},
|
||||
"admin_token": "K7-6eQSzh7Lgcb5vuWZGODO1nrIAu1gFv7KxFJoYPSn15NFT8E9-iNy6AFaEQEkE9mb0tK0",
|
||||
"admin_token": "D2IMmmxhLcL_DJMUMbmXxMuebowhWz0m8jBBwyCjI80wWz8kMfW2XqSsoXydz3oluL9gcns",
|
||||
"project_id": "",
|
||||
"client_id": "350170398056316942",
|
||||
"client_secret": "ej5NkifamoHntY21FFvz18wygcgFFKtaLpwW4lN1XHwMHRGWb5GrzFxIeaA1iqZu"
|
||||
"client_id": "350192628773486606",
|
||||
"client_secret": "lMT0aQarbjRVBRtzFUlheVkqKZlbcVO8j58EHOu0gIl4W65BGJVEc6k7WxJ8v4wr"
|
||||
}
|
||||
|
|
@ -1,16 +1,18 @@
|
|||
use crate::package_manager::{get_all_components, InstallMode, PackageManager};
|
||||
use anyhow::Result;
|
||||
use std::env;
|
||||
use std::process::Command;
|
||||
use crate::package_manager::{get_all_components, InstallMode, PackageManager};
|
||||
pub async fn run() -> Result<()> {
|
||||
env_logger::init();
|
||||
// Logger is already initialized in main.rs, don't initialize again
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() < 2 {
|
||||
print_usage();
|
||||
return Ok(());
|
||||
}
|
||||
use tracing::info;
|
||||
fn print_usage(){info!("usage: botserver <command> [options]")}
|
||||
use tracing::info;
|
||||
fn print_usage() {
|
||||
info!("usage: botserver <command> [options]")
|
||||
}
|
||||
let command = &args[1];
|
||||
match command.as_str() {
|
||||
"start" => {
|
||||
|
|
@ -41,7 +43,10 @@ fn print_usage(){info!("usage: botserver <command> [options]")}
|
|||
println!("Stopping all components...");
|
||||
let components = get_all_components();
|
||||
for component in components {
|
||||
let _ = Command::new("pkill").arg("-f").arg(component.termination_command).output();
|
||||
let _ = Command::new("pkill")
|
||||
.arg("-f")
|
||||
.arg(component.termination_command)
|
||||
.output();
|
||||
}
|
||||
println!("✓ BotServer components stopped");
|
||||
}
|
||||
|
|
@ -49,7 +54,10 @@ fn print_usage(){info!("usage: botserver <command> [options]")}
|
|||
println!("Restarting BotServer...");
|
||||
let components = get_all_components();
|
||||
for component in components {
|
||||
let _ = Command::new("pkill").arg("-f").arg(component.termination_command).output();
|
||||
let _ = Command::new("pkill")
|
||||
.arg("-f")
|
||||
.arg(component.termination_command)
|
||||
.output();
|
||||
}
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
|
||||
let mode = if args.contains(&"--container".to_string()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue