mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-28 07:57:01 +00:00
feat(admin): enhance notification event handlers (#530)
* add log * add logs * test * cargo fmt * add event admin api * feat: add ImportIam handle * refact bucket replication * Update ecstore/src/disk/endpoint.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: weisd <weishidavip@163.com> Co-authored-by: lygn128 <lygn128@163.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -130,7 +130,16 @@ impl Debug for LocalDisk {
|
||||
|
||||
impl LocalDisk {
|
||||
pub async fn new(ep: &Endpoint, cleanup: bool) -> Result<Self> {
|
||||
let root = fs::canonicalize(ep.get_file_path()).await?;
|
||||
debug!("Creating local disk");
|
||||
let root = match fs::canonicalize(ep.get_file_path()).await {
|
||||
Ok(path) => path,
|
||||
Err(e) => {
|
||||
if e.kind() == ErrorKind::NotFound {
|
||||
return Err(DiskError::VolumeNotFound.into());
|
||||
}
|
||||
return Err(to_file_error(e).into());
|
||||
}
|
||||
};
|
||||
|
||||
if cleanup {
|
||||
// TODO: 删除 tmp 数据
|
||||
@@ -140,7 +149,7 @@ impl LocalDisk {
|
||||
.join(Path::new(super::FORMAT_CONFIG_FILE))
|
||||
.absolutize_virtually(&root)?
|
||||
.into_owned();
|
||||
|
||||
debug!("format_path: {:?}", format_path);
|
||||
let (format_data, format_meta) = read_file_exists(&format_path).await?;
|
||||
|
||||
let mut id = None;
|
||||
@@ -245,7 +254,7 @@ impl LocalDisk {
|
||||
|
||||
let root = disk.root.clone();
|
||||
tokio::spawn(Self::cleanup_deleted_objects_loop(root, exit_rx));
|
||||
|
||||
debug!("LocalDisk created: {:?}", disk);
|
||||
Ok(disk)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user