From ec136294c5331d75d9f0860c54bc3d1ae9a2f36c Mon Sep 17 00:00:00 2001 From: Darryl Nixon Date: Sun, 16 Jul 2023 15:01:37 -0700 Subject: [PATCH] more async bugs --- melamine/shred.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/melamine/shred.py b/melamine/shred.py index af5237e..d027dc0 100644 --- a/melamine/shred.py +++ b/melamine/shred.py @@ -63,7 +63,8 @@ async def main(job: argparse.Namespace) -> bool: async def check_inode_and_unlink(item, inodes): async with semaphore: - if await item.stat().st_ino in inodes: + stat = await item.stat() + if await stat.st_ino in inodes: log_buf = f"Deleting hardlink: {item.path}" if not job.dryrun: log_buf = "DRY RUN " + log_buf @@ -78,6 +79,7 @@ async def main(job: argparse.Namespace) -> bool: check_paths = [mount_point / path for path in ("/proc", "/dev", "/sys")] manual_process = any(asyncio.gather(*[path.exists() for path in check_paths])) if manual_process: + logger.warning("Us") # Traverse every directory in mount_point recursively except /proc, /dev, and /sys async for item in mount_point.glob("*"): if await item.is_dir():