mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 08:06:54 +00:00
improve code for main
This commit is contained in:
+6
-2
@@ -93,6 +93,10 @@ fn main() -> Result<()> {
|
|||||||
//设置 trace
|
//设置 trace
|
||||||
// setup_tracing();
|
// setup_tracing();
|
||||||
|
|
||||||
|
let config = load_config(Some(opt.clone().obs_config));
|
||||||
|
// Initialize Observability
|
||||||
|
let (_logger, _guard) = tokio::runtime::Runtime::new()?.block_on(async { init_obs(config).await });
|
||||||
|
|
||||||
//运行参数
|
//运行参数
|
||||||
run(opt)
|
run(opt)
|
||||||
}
|
}
|
||||||
@@ -100,9 +104,9 @@ fn main() -> Result<()> {
|
|||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn run(opt: config::Opt) -> Result<()> {
|
async fn run(opt: config::Opt) -> Result<()> {
|
||||||
debug!("opt: {:?}", &opt);
|
debug!("opt: {:?}", &opt);
|
||||||
let config = load_config(Some(opt.clone().obs_config));
|
// let config = load_config(Some(opt.clone().obs_config));
|
||||||
// Initialize Observability
|
// Initialize Observability
|
||||||
init_obs(config).await;
|
// let (_logger, _guard) = init_obs(config).await;
|
||||||
|
|
||||||
let mut server_addr = net::check_local_server_addr(opt.address.as_str()).unwrap();
|
let mut server_addr = net::check_local_server_addr(opt.address.as_str()).unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user