Improve hardlink logging

This commit is contained in:
Darryl Nixon 2023-07-16 10:38:46 -07:00
parent 5a4d74936b
commit e60812c136

View file

@ -33,7 +33,13 @@ async def main(job) -> bool:
# Get hardlinks to subsequently unlink for all files # Get hardlinks to subsequently unlink for all files
for path in job.paths: for path in job.paths:
if isinstance(path, ShredFile): 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 # Shred all physical files including hardlinks
for path in job.paths: for path in job.paths: