Skip to content

Why this keeps walking the same entry? #18

@Magicloud

Description

@Magicloud

With this filter, the debug line outputs the same dir and repeat for ever. I assumed that even my filter is broken, it should loop on the same node.

The version is v2.1.0.

while let Some(x) = WalkDir::new("/sys/fs/cgroup/kubepods")
                    .filter(|x| async move {
                        if x.file_type().await.is_ok_and(|x| x.is_dir()) {
                            if x.path()
                                .parent()
                                .and_then(|x| x.to_str())
                                .unwrap_or_default()
                                .starts_with("pod")
                            {
                                Filtering::IgnoreDir
                            } else {
                                Filtering::Continue
                            }
                        } else {
                            Filtering::Ignore
                        }
                    })
                    .next()
                    .await
                {
                    let cgroup_folder = x?;
                    debug!("{cgroup_folder:?}");
/// Other codes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions