diff --git a/Cargo.lock b/Cargo.lock index 224788e12..1e169b510 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8205,6 +8205,7 @@ name = "rustfs-ecstore" version = "0.0.5" dependencies = [ "async-channel", + "async-recursion", "async-trait", "aws-sdk-s3", "base64 0.22.1", diff --git a/crates/ecstore/Cargo.toml b/crates/ecstore/Cargo.toml index 1e3d815e5..90ea21ab6 100644 --- a/crates/ecstore/Cargo.toml +++ b/crates/ecstore/Cargo.toml @@ -100,6 +100,7 @@ rustfs-rio.workspace = true rustfs-signer.workspace = true rustfs-checksums.workspace = true futures-util.workspace = true +async-recursion.workspace = true [target.'cfg(not(windows))'.dependencies] nix = { workspace = true } diff --git a/crates/ecstore/src/disk/local.rs b/crates/ecstore/src/disk/local.rs index 8da377967..c363988cd 100644 --- a/crates/ecstore/src/disk/local.rs +++ b/crates/ecstore/src/disk/local.rs @@ -440,6 +440,7 @@ impl LocalDisk { } #[tracing::instrument(level = "debug", skip(self))] + #[async_recursion::async_recursion] pub async fn delete_file( &self, base_path: &PathBuf, @@ -803,13 +804,17 @@ impl LocalDisk { Ok(()) } - async fn scan_dir( + #[async_recursion::async_recursion] + async fn scan_dir( &self, current: &mut String, opts: &WalkDirOptions, out: &mut MetacacheWriter, objs_returned: &mut i32, - ) -> Result<()> { + ) -> Result<()> + where + W: AsyncWrite + Unpin + Send, + { let forward = { opts.forward_to.as_ref().filter(|v| v.starts_with(&*current)).map(|v| { let forward = v.trim_start_matches(&*current);