mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-17 18:27:49 +00:00
add logs
This commit is contained in:
@@ -13,7 +13,7 @@ use http::HeaderMap;
|
||||
use lazy_static::lazy_static;
|
||||
use s3s::dto::StreamingBlob;
|
||||
use s3s::Body;
|
||||
use tracing::error;
|
||||
use tracing::{error, warn};
|
||||
|
||||
pub const CONFIG_PREFIX: &str = "config";
|
||||
const CONFIG_FILE: &str = "config.json";
|
||||
@@ -101,9 +101,12 @@ pub async fn read_config_without_migrate(api: &ECStore) -> Result<Config> {
|
||||
Ok(res) => res,
|
||||
Err(err) => {
|
||||
if is_not_found(&err) {
|
||||
warn!("config not found init start");
|
||||
let cfg = new_and_save_server_config(api).await?;
|
||||
warn!("config not found init done");
|
||||
return Ok(cfg);
|
||||
} else {
|
||||
error!("read config err {:?}", &err);
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
@@ -120,9 +123,12 @@ async fn read_server_config(api: &ECStore, data: &[u8]) -> Result<Config> {
|
||||
Ok(res) => res,
|
||||
Err(err) => {
|
||||
if is_not_found(&err) {
|
||||
warn!("config not found init start");
|
||||
let cfg = new_and_save_server_config(api).await?;
|
||||
warn!("config not found init done");
|
||||
return Ok(cfg);
|
||||
} else {
|
||||
error!("read config err {:?}", &err);
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user