From e60812c1369b0a2fd8a5490f1eaa810f4f4d125e Mon Sep 17 00:00:00 2001 From: Darryl Nixon Date: Sun, 16 Jul 2023 10:38:46 -0700 Subject: [PATCH] Improve hardlink logging --- melamine/shred.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/melamine/shred.py b/melamine/shred.py index cba00bb..a306f9a 100644 --- a/melamine/shred.py +++ b/melamine/shred.py @@ -33,7 +33,13 @@ async def main(job) -> bool: # Get hardlinks to subsequently unlink for all files for path in job.paths: if isinstance(path, ShredFile): - path.hardlinks = set(link async for link in path.fs_handler.get_hardlinks(path)) + logger.info("Getting hardlinks for {path}") + hardlink_count = 0 + path.hardlinks = set() + async for link in path.fs_handler.get_hardlinks(path): + hardlink_count += 1 + path.hardlinks.add(link) + logger.info(f"Found hardlink: {link}") # Shred all physical files including hardlinks for path in job.paths: